public static Game GetInstance() { if (!instance) { instance = GameObject.FindObjectOfType(typeof(Game)) as Game; if (!instance) { Debug.LogError("There must be one active Game object in your scene."); } } return instance; }
void Awake() { game = Game.GetInstance(); cameraController = game.gameObject.GetComponent<CameraController>(); commandQueue = game.gameObject.GetComponent<CommandQueue>(); }