serializedproperty
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
serializedproperty [2021/10/10 18:21] – created artehacker | serializedproperty [2025/01/15 04:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 6: | Line 6: | ||
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' | 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' | ||
+ | |||
+ | Modifying SerializedProperty.arraySize will copy the complete array to all the edited targets, but changing the size serialized property instead will only copy the array' | ||
+ | Example: | ||
+ | <code cs> | ||
+ | SerializedProperty prop = serializedObject.FindProperty(" | ||
+ | |||
+ | // This will make each array element in the different selected targets the same. Mixed values will be lost. | ||
+ | prop.arraySize++ | ||
+ | |||
+ | // This will keep the different values of the array elements in the selected targets. | ||
+ | // Note that targets with an array size bigger than prop.arraySize will still lose some elements. | ||
+ | prop.FindPropertyRelative(" | ||
+ | </ | ||
+ |
serializedproperty.1633890103.txt.gz · Last modified: 2025/01/15 04:35 (external edit)