Пример #1
0
    private void Setup()
    {
        foreach (TeamHandler team in m_Teams)
        {
            // Based on the number of players chosen in the lobby screen, this will remove the tanks from the current game
            if (GameManager.instance != null)
            {
                for (int x = team.GetTeamControllers().Length; x > GameManager.instance.teamInfos[team.Team]; x--)
                {
                    team.GetTeamControllers()[x - 1].gameObject.GetComponent <Stats>().SetAlive(false);
                    team.GetTeamControllers()[x - 1].gameObject.SetActive(false);
                }
            }

            foreach (TankController controller in team.GetTeamControllers())
            {
                ActivateCharacter(controller, false);
                if (controller.isActiveAndEnabled)
                {
                    IgnoreCollisionsWithOtherPlayers(controller.gameObject);
                }
            }
        }

        m_ActiveTeam            = m_Teams[m_ActiveTeamIndex];
        m_ActiveTeamControllers = m_ActiveTeam.GetTeamControllers();
        m_ActiveTeamStats       = m_ActiveTeam.GetTeamStats();
        m_ActiveCharacter       = m_ActiveTeamControllers[m_ActiveCharacterIndex];
        ActivateCharacter(m_ActiveCharacter, true);

        m_TimerCoroutine = StartCoroutine(TurnTimer.Instance.StartTimer());
        TurnTimer.Instance.PauseTimer();
        m_ProjectileCamera.depth = -10;
    }
Пример #2
0
 private void NextCharacter()
 {
     if (m_ActiveCharacterIndex + 1 < m_ActiveTeam.GetTeamControllers().Length)
     {
         m_ActiveCharacterIndex++;
     }
     else
     {
         do
         {
             m_ActiveTeamIndex       = (m_ActiveTeamIndex + 1) % m_Teams.Count;
             m_ActiveTeam            = m_Teams[m_ActiveTeamIndex];
             m_ActiveTeamControllers = m_ActiveTeam.GetTeamControllers();
             m_ActiveTeamStats       = m_ActiveTeam.GetTeamStats();
             m_ActiveCharacterIndex  = 0;
         } while (m_ActiveTeamControllers.Length <= 0);
     }
 }