Пример #1
0
        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;
        }
Пример #2
0
 void Awake()
 {
     game = Game.GetInstance();
     cameraController = game.gameObject.GetComponent<CameraController>();
     commandQueue = game.gameObject.GetComponent<CommandQueue>();
 }