void RemoveState(int index) { serializedObject.FindProperty("AlternateStateList").DeleteArrayElementAtIndex(index); serializedObject.ApplyModifiedProperties(); AlternateStateBase.RemoveAt(index); AlternateStateAdvanced.RemoveAt(index); StoreReferences(); }
void AddNewState(int index) { serializedObject.FindProperty("AlternateStateList").InsertArrayElementAtIndex(index); serializedObject.ApplyModifiedProperties(); // Assign default values so that the previous index values are not copied. targ.AlternateStateList[index] = new AlternateStateHandler.AlternateState(); AlternateStateBase.Insert(index, new AnimBool(false)); AlternateStateBase[index].target = true; AlternateStateAdvanced.Insert(index, new AnimBool(false)); EditorUtility.SetDirty(targ); // Store the references to get the information. StoreReferences(); }