Example #1
0
        void Awake()
        {
            // Set the current scene controller.
            Director director = Director.GetInstance();

            director.currentSceneController = this;
            // Add GUI.
            gui = gameObject.AddComponent <GameGUI>() as GameGUI;
            // Load the resources.
            LoadResources();
        }
 void Awake()
 {
     // Set the current scene controller and load resources.
     Director.GetInstance().OnSceneWake(this);
     // Add GUI.
     gui = gameObject.AddComponent <GameGUI>() as GameGUI;
     // Initialize the action manager.
     actionManager = gameObject.AddComponent <GameActionManager>();
     // Initialize the game model.
     // 初始化裁判类。
     game = new Game(boat.model, leftCoast.model, rightCoast.model);
     // 裁判类通知场景控制器游戏胜负。
     game.onChange += delegate
     {
         gui.result = game.result;
     };
 }