// main logic private void Init() { if (!gameController) { gameController = GameController_Plt2D.Instance; } }
public override void OnInspectorGUI() { DrawDefaultInspector(); GameController_Plt2D spc = (GameController_Plt2D)target; if (GUILayout.Button("Set Time Scale = 1")) { Time.timeScale = 1f; } if (GUILayout.Button("Set Time Scale = 0.75")) { Time.timeScale = 0.75f; } if (GUILayout.Button("Set Time Scale = 0.5")) { Time.timeScale = 0.5f; } if (GUILayout.Button("Set Time Scale = 0")) { Time.timeScale = 0f; } }
// main event void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } }
// main logic public override void Init() { base.Init(); if (!coinSpawner) { coinSpawner = myGO.GetComponent <SpawnCoins_Plt2D> (); } if (!gameController) { gameController = GameController_Plt2D.Instance; } }