void Awake() { if (Instance != null && Instance != this) { Destroy(gameObject); } Instance = this; DontDestroyOnLoad(gameObject); }
public override void OnInspectorGUI() { DrawDefaultInspector(); FakeRunner myTarget = (FakeRunner)target; if (GUILayout.Button("Run Me")) { ((FakeRunner)target).RunMe(); } if (GUILayout.Button("Select ALL")) { ((FakeRunner)target).SelectAll(); } if (GUILayout.Button("Select NONE")) { ((FakeRunner)target).SelectNone(); } }