示例#1
0
        // Use this for initialization
        protected virtual void Awake()
        {
            btnDifficulty[0] = transform.Find("pnlDifficulties").Find("btnEasy").GetComponent <Button>();
            btnDifficulty[1] = transform.Find("pnlDifficulties").Find("btnDefault").GetComponent <Button>();
            btnDifficulty[2] = transform.Find("pnlDifficulties").Find("btnHard").GetComponent <Button>();

            btnInitialize = transform.Find("btnInitialize").GetComponent <Button>();
            btnStart      = transform.Find("btnStart").GetComponent <Button>();
            btnAbort      = transform.Find("btnAbort").GetComponent <Button>();
            btnComplete   = transform.Find("btnComplete").GetComponent <Button>();

            transform.Find("pnlGameMonitor").Find("lblStatsCaptions").GetComponent <Text>().text = statsCaptionStr;
            lblState = transform.Find("lblState").GetComponent <Text>();
            lblStats = transform.Find("pnlGameMonitor").Find("lblStats").GetComponent <Text>();

            timeToUpdate = statsUpdateInterval;

            EscapeRoom <IEtsInterface> room = Ets.Room;

            scoring = room.GetModule <ScoringModule>();
            if (room == null || room.GetGame(gameId) == null)
            {
                DisableButtons();
            }
            else
            {
                game = room.GetGame(gameId);
                //print("Game found: " + game);
                Text lblTitle = transform.Find("lblTitle").GetComponent <Text>();
                lblTitle.text = game.Id.ToUpper();

                room.OnRoomStateChanged += OnRoomStateChanged;
                game.OnGameStateChanged += OnGameStateChanged;
                //OnRoomStateChanged(Room, Room.State, Room.State);
                //OnGameStateChanged(Game, Game.State, Game.State);
            }
        }