Uninomicon

Documenting the dark corners of the Unity Engine.

User Tools

Site Tools


serializedproperty

This is an old revision of the document!


SerializedProperty

Array size for multi-object editing

SerializedProperty.arraySize is said to return the smallest number of elements when editing multiple objects at the same time, but the docs are incorrect about that. It will return the array size of the first of the SerializedObject's targets, even if it's not the smallest.

On the other hand, serialized properties for array elements with an index outside the range of the smallest array size will still represent incorrect properties, so it's still important to get the smallest array size manually, or to iterate through the array's elements using Next/NextVisible.

serializedproperty.1633890103.txt.gz · Last modified: 2021/10/10 18:21 by artehacker