public override void OnInspectorGUI() { Catenary catenary = (Catenary)target; DrawDefaultInspector(); if (catenary.lockEditing == false) { if (GUI.changed) { catenary.Regenerate(); } if (GUILayout.Button("Create RopeEnds") && catenary.p1 == null && catenary.p2 == null) { CreateRopeStart(catenary); CreateRopeEnd(catenary); } if (GUILayout.Button("Destroy Rope Ends")) { DestroyImmediate(catenary.p1.gameObject); catenary.p1 = null; DestroyImmediate(catenary.p2.gameObject); catenary.p2 = null; } if (GUILayout.Button("Unassign previous ends")) { catenary.p1 = null; catenary.p2 = null; } } }
public override void OnInspectorGUI() { DrawDefaultInspector(); if (GUI.changed) { Catenary catenary = (Catenary)target; catenary.Regenerate(); } }