Esempio n. 1
0
        void Awake()
        {
            this.m_ViewModel  = this.gameObject.GetComponent <GameRoomViewModel>();
            this.m_Preference = UIManager.Instance.GetUI("GameRoomView").
                                GetComponent <GameRoomViewPreference>();
            this.m_BoardPreferene = GameManager.Instance.checherBoardViewPreference;
            GameObject chessPreb =
                Resources.Load("Prefab/chessFlash") as GameObject;;

            this.m_currentObjectView = GameManager.Instance.ChessFlashItemView;
            this.m_Preference.btnPlace.onClick.AddListener(this.OnBtnPlaceClick);
        }
Esempio n. 2
0
        void Awake()
        {
            this.m_ViewModel  = this.gameObject.GetComponent <PrepareViewModel>();
            this.m_Preference = UIManager.Instance.GetUI("PrepareView").
                                GetComponent <PrepareViewPreference>();
            this.m_BoardPreferene = GameManager.Instance.checherBoardViewPreference;
            ObjectPool pool = ObjectPoolManager.Instance.
                              CreateObjectPool <ChessPool>(PoolType.Chess, this.m_BoardPreferene.transform);

            pool.Prefab = Resources.Load("Prefab/chess") as GameObject;
            this.m_currentObjectView = GameManager.Instance.ChessFlashItemView;
            this.m_Preference.btnBoat.onClick.AddListener(this.OnBtnBoatClick);
            this.m_Preference.btnShip.onClick.AddListener(this.OnBtnShipClick);
            this.m_Preference.btnVessel.onClick.AddListener(this.OnBtnVesselClick);
            this.m_Preference.btnRotate.onClick.AddListener(this.OnBtnRotateClick);
            this.m_Preference.btnPlace.onClick.AddListener(this.OnBtnPlaceClick);
            this.m_Preference.btnStart.onClick.AddListener(this.OnBtnStartClick);

            this.m_Preference.txtBoatCount.text   = this.m_BoatCount.ToString();
            this.m_Preference.txtShipCount.text   = this.m_ShipCount.ToString();
            this.m_Preference.txtVesselCount.text = this.m_vesselCount.ToString();
        }