SerializedProperty myArray = serializedObject.FindProperty("myArray"); SerializedProperty element = myArray.GetArrayElementAtIndex(1);
SerializedProperty myArray = serializedObject.FindProperty("myArray"); SerializedProperty element = myArray.GetArrayElementAtIndex(2); element.intValue = 5;Here, we retrieve the SerializedProperty for the third element in myArray and then set its intValue property to 5. The SerializedProperty.GetArrayElementAtIndex method is part of the UnityEditor namespace in the UnityEngine.dll package library.