Example #1
0
        /// <summary>
        /// 结束回合
        /// </summary>
        public void EndTurn()
        {
            Team currentTeam = teams[currentTurnTeamIndex];

            currentTeam.IsSelfTurn = false;
            if (currentTeam.GetCurrentTurnPlayer() != null)
            {
                currentTeam.GetCurrentTurnPlayer().PlayerController.enabled = false;
            }
            currentTeam.NextTurn();
            NextTurn();

            OnTurnEnd.Invoke();
        }
Example #2
0
        /// <summary>
        /// 开始回合
        /// </summary>
        public void StartTurn()
        {
            //GameManager.Instance.Log("当前回合队伍index" + currentTurnTeamIndex);
            Team currentTeam = teams[currentTurnTeamIndex];

            currentTeam.IsSelfTurn = true;
            if (currentTeam.GetCurrentTurnPlayer() != null)
            {
                currentTeam.GetCurrentTurnPlayer().PlayerController.enabled = true;
            }
            //初始化回合参数(风力等。。)
            turnProperties.WindForce = new Vector2(Random.Range(-5f, 5f) * 50, 0);
            OnTurnStart.Invoke();
        }
Example #3
0
 private void RemoveSelf()
 {
     belongsTo.RemoveTeamPlayer(this);
     if (belongsTo.GetCurrentTeamPlayerCount() > 0)
     {
         GameManager.Instance.TurnBaseController.EndTurn();
         GameManager.Instance.TurnBaseController.StartTurn();
     }
     else
     {
         Team winTeam = GameManager.Instance.TurnBaseController.GetTeam(GameManager.Instance.TurnBaseController.NextTurnTeamIndex());
         Debug.Log(winTeam.Name + "Win");
         UIManager.Instance.ShowWinInfoUI(winTeam.Name);
         GameManager.Instance.vCam.Follow = winTeam.GetCurrentTurnPlayer().gameObject.transform;
         //Time.timeScale = 0;
     }
 }