Ejemplo n.º 1
0
        public void ToGame()
        {
            CurPlayer = 1;

            Hammer = GameObject.Instantiate(PrefabPool.GetPrefab("model/hammer"), Vector3.one * 100, Quaternion.identity)
                     .GetComponent <Hammer>();
            Hammer.gameObject.SetActive(true);

            UIGame uiGame = UIManager.CreateUI <UIGame>();

            uiGame.SetRoomConfig();
            uiGame.SetCurPlayer(CurPlayer);

            // camera
            if (GameConf.MapType == MapType.Small)
            {
                Camera.main.transform.position = new Vector3(1.57f, 9.07f, -5.82f);
            }
            else if (GameConf.MapType == MapType.Middle)
            {
                Camera.main.transform.position = new Vector3(2.18f, 9.07f, -7.01f);
            }
            else if (GameConf.MapType == MapType.Big)
            {
                Camera.main.transform.position = new Vector3(2.58f, 9.07f, -8.2f);
            }

            HexManager = AddChild(new HexManager()) as HexManager;



            GameStep = GameStep.SelectingMain;
        }
Ejemplo n.º 2
0
        private void NextPlayer(bool isGood = false)
        {
            ++CurPlayer;
            if (CurPlayer > GameConf.MemCount)
            {
                CurPlayer = 1;
            }

            UIGame uiGame = UIManager.GetUIByType <UIGame>();

            uiGame.SetCurPlayer(CurPlayer);

            string goodOrNot = isGood ? "GOOD!!!\n" : "";

            UIManager.SendMessage(MsgType.OnShowTips, goodOrNot + "下回合: 玩家" + CurPlayer);
        }
Ejemplo n.º 3
0
        public void Restart()
        {
            m_curTargetHex    = null;
            m_singleTargetHex = null;
            m_mainHex         = null;
            HexManager.Restart();
            CurPlayer = 1;

            Hammer.transform.position = Vector3.one * 100;
            UIGame gameUI = UIManager.GetUIByType <UIGame>();

            gameUI.ShowWheel(false);
            gameUI.SetCurPlayer(CurPlayer);

            GameStep = GameStep.SelectingMain;
        }