Пример #1
0
    /// <summary>
    ///
    /// </summary>
    void AutoTeam()
    {
        string joinText = isOneTeamMode ? bl_GameTexts.JoinedInMatch : bl_GameTexts.JoinIn;

#if LOCALIZATION
        joinText = isOneTeamMode ? bl_Localization.Instance.GetText(17) : bl_Localization.Instance.GetText(23);
#endif
        if (CanSpawn && !isPlaying && !AlredyAuto)
        {
            AlredyAuto = true;
            if (!isOneTeamMode)
            {
                if (GetPlayerInDeltaCount > GetPlayerInReconCount)
                {
                    bl_UtilityHelper.LockCursor(true);
                    showMenu = false;
                    GM.SpawnPlayer(Team.Recon);
                    bl_EventHandler.KillEvent(PhotonNetwork.NickName, string.Empty, joinText + Team.Recon.GetTeamName(), Team.Recon.ToString(), 777, 30);
                    isPlaying = true;
                }
                else if (GetPlayerInDeltaCount < GetPlayerInReconCount)
                {
                    bl_UtilityHelper.LockCursor(true);
                    showMenu = false;
                    GM.SpawnPlayer(Team.Delta);
                    bl_EventHandler.KillEvent(PhotonNetwork.NickName, string.Empty, joinText + Team.Delta.GetTeamName(), Team.Delta.ToString(), 777, 30);
                    isPlaying = true;
                }
                else if (GetPlayerInDeltaCount == GetPlayerInReconCount)
                {
                    bl_UtilityHelper.LockCursor(true);
                    showMenu = false;
                    GM.SpawnPlayer(Team.Delta);
                    bl_EventHandler.KillEvent(PhotonNetwork.NickName, string.Empty, joinText + Team.Delta.GetTeamName(), Team.Delta.ToString(), 777, 30);
                    isPlaying = true;
                }
            }
            else
            {
                bl_UtilityHelper.LockCursor(true);
                showMenu = false;
                GM.SpawnPlayer(Team.All);
                bl_EventHandler.KillEvent(PhotonNetwork.NickName, string.Empty, joinText, Team.Delta.ToString(), 777, 30);
                isPlaying = true;
            }
            UIReferences.AutoTeam(false);
        }
        else
        {
            UIReferences.AutoTeam(true);
        }
    }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 void AutoTeam()
 {
     if (CanSpawn && !isPlaying && !AlredyAuto)
     {
         AlredyAuto = true;
         if (GetGameMode != GameMode.FFA)
         {
             if (GetPlayerInDeltaCount > GetPlayerInReconCount)
             {
                 bl_UtilityHelper.LockCursor(true);
                 showMenu = false;
                 GM.SpawnPlayer(Team.Recon);
                 bl_EventHandler.KillEvent(PhotonNetwork.player.NickName, "", bl_GameTexts.JoinIn + Team.Recon.GetTeamName(), Team.Recon.ToString(), 777, 30);
                 isPlaying = true;
             }
             else if (GetPlayerInDeltaCount < GetPlayerInReconCount)
             {
                 bl_UtilityHelper.LockCursor(true);
                 showMenu = false;
                 GM.SpawnPlayer(Team.Delta);
                 bl_EventHandler.KillEvent(PhotonNetwork.player.NickName, "", bl_GameTexts.JoinIn + Team.Delta.GetTeamName(), Team.Delta.ToString(), 777, 30);
                 isPlaying = true;
             }
             else if (GetPlayerInDeltaCount == GetPlayerInReconCount)
             {
                 bl_UtilityHelper.LockCursor(true);
                 showMenu = false;
                 GM.SpawnPlayer(Team.Delta);
                 bl_EventHandler.KillEvent(PhotonNetwork.player.NickName, "", bl_GameTexts.JoinIn + Team.Delta.GetTeamName(), Team.Delta.ToString(), 777, 30);
                 isPlaying = true;
             }
         }
         else
         {
             bl_UtilityHelper.LockCursor(true);
             showMenu = false;
             GM.SpawnPlayer(Team.All);
             bl_EventHandler.KillEvent(PhotonNetwork.player.NickName, "", bl_GameTexts.JoinedInMatch, Team.Delta.ToString(), 777, 30);
             isPlaying = true;
         }
         UIReferences.AutoTeam(false);
     }
     else
     {
         UIReferences.AutoTeam(true);
     }
 }