private void OnListAdd(ReorderableList list) { SerializedProperty property = list.AddItem(); property.FindPropertyRelative("Active").boolValue = true; property.FindPropertyRelative("Frequency").floatValue = 1f; property.FindPropertyRelative("Amplitude").floatValue = 1f; property.FindPropertyRelative("Offset").floatValue = 0f; property.FindPropertyRelative("Phase").floatValue = 0f; }
public override void OnInspectorGUI() { _Events.DoLayoutList(); if (GUILayout.Button("Add Event")) { _Events.AddItem(new USBAnimationEvent()); } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); SpawnPointManager spm = target as SpawnPointManager; if (GUILayout.Button("Create Spawn Point")) { GameObject sp = new GameObject("spawnPoint"); sp.transform.SetParent(spm.transform); list1.AddItem <Transform>(sp.transform); } //draw the list using GUILayout, you can of course specify your own position and label list1.DoLayoutList(); serializedObject.ApplyModifiedProperties(); }