slightly reduced memory footprint of API structs by applying Auto Struct layout (improves alignment and reduces offsets of unused memory between fields of the struct)
changed backing type of enums to byte which in turn should also reduce size of structs a little where used
fixed InvalidCastException when casting byte to generic enum in DropDownOption<TEnum>,
Note it's not possible to constraint Enum backing type to byte in DropDownOption so all enums used for dropdown ui must have a byte as backing type otherwise will throw InvalidCastException at runtime.
Whole implementation has a flaw anyways because current implementation of SerializableUIOption is saving value as byte so any enum larger than bytewill be saved and restored incorrectly. For now everything works because we don't use such big enums for dropdown values, so it's something to handle in the future or better avoid such use case.
byte
which in turn should also reduce size of structs a little where usedInvalidCastException
when casting byte to generic enum inDropDownOption<TEnum>
,Note it's not possible to constraint
Enum
backing type to byte inDropDownOption
so all enums used for dropdown ui must have abyte
as backing type otherwise will throwInvalidCastException
at runtime. Whole implementation has a flaw anyways because current implementation ofSerializableUIOption
is saving value asbyte
so anyenum
larger thanbyte
will be saved and restored incorrectly. For now everything works because we don't use such bigenums
for dropdown values, so it's something to handle in the future or better avoid such use case.Build ZIP