public override void OnInspectorGUI() { DrawDefaultInspector(); CatapultPowerUI myTarget = (CatapultPowerUI)target; if (Application.isPlaying) { if (GUILayout.Button("Show")) { myTarget.Show(); } if (GUILayout.Button("Hide")) { myTarget.Hide(); } } else { if (GUILayout.Button("Enable play mode")) { } if (GUILayout.Button("Enable play mode")) { } } }
public void TogglePowerUI(bool value) { if (oldPowerValue == value) { return; } if (value) { powerUI.Show(); } else { powerUI.Hide(); } oldPowerValue = value; }