コード例 #1
0
    //this component allow us to keep the color selected by the player on the lobby, it will be the color of the player when the game start.

    public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer)
    {
        base.OnLobbyServerSceneLoadedForPlayer(manager, lobbyPlayer, gamePlayer);

        Prototype.NetworkLobby.LobbyPlayer lobbyP = lobbyPlayer.GetComponent <Prototype.NetworkLobby.LobbyPlayer>();
        PlayerColor cameraPlayer = gamePlayer.GetComponent <PlayerColor>(); //access to the playerColor component, wich has the information of the color

        cameraPlayer.pColor = lobbyP.playerColor;                           //Makes the player color the same as the selected by the player on the lobby
    }
コード例 #2
0
 public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer)
 {
     if (lobbyPlayer == null)
     {
         return;
     }
     Prototype.NetworkLobby.LobbyPlayer lp = lobbyPlayer.GetComponent <Prototype.NetworkLobby.LobbyPlayer>();
     if (lp != null)
     {
         GameManager.AddPlayer(gamePlayer, lp.nameInput.text);
     }
 }
コード例 #3
0
ファイル: LobbyPlayerList.cs プロジェクト: Kundara/project1
        public void AddPlayer(LobbyPlayer player)
        {
            if (_players.Contains(player))
                return;

            _players.Add(player);

            player.transform.SetParent(playerListContentTransform, false);
            addButtonRow.transform.SetAsLastSibling();

            PlayerListModified();
        }
コード例 #4
0
    public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer)
    {
        if (lobbyPlayer == null)
        {
            return;
        }

        Prototype.NetworkLobby.LobbyPlayer lp = lobbyPlayer.GetComponent <Prototype.NetworkLobby.LobbyPlayer>();

        if (lp != null)
        {
            GameManager.AddTank(gamePlayer, lp.slot, lp.playerColor, lp.nameInput.text, lp.playerControllerId, lp.connectionToClient.connectionId);
        }
    }
コード例 #5
0
 //This will reset every player's character selection to observer
 void lobby_change_map(int new_map)
 {
     if (map != new_map)
     {
         map = (int)new_map;
         for (int i = 0; i < lobbyManager.lobbySlots.Length; i++)
         {
             if (lobbyManager.lobbySlots[i] == null)
             {
                 continue;
             }
             Prototype.NetworkLobby.LobbyPlayer player = (Prototype.NetworkLobby.LobbyPlayer)lobbyManager.lobbySlots[i];
             player.reset_character();
         }
     }
 }
コード例 #6
0
ファイル: LobbyManager.cs プロジェクト: thrigby/Bookiboo
 public void RemovePlayer(LobbyPlayer player)
 {
     player.RemovePlayer();
 }
コード例 #7
0
ファイル: LobbyManager.cs プロジェクト: Minro4/Bang
 public void RemovePlayer(LobbyPlayer player)
 {
     player.RemovePlayer();
 }
コード例 #8
0
 public void RemovePlayer(LobbyPlayer player)
 {
     _players.Remove(player);
     PlayerListModified();
 }
コード例 #9
0
ファイル: LobbyPlayerList.cs プロジェクト: Kundara/project1
 public void RemovePlayer(LobbyPlayer player)
 {
     _players.Remove(player);
     PlayerListModified();
 }
コード例 #10
0
ファイル: LobbyManager.cs プロジェクト: episanchez/Azurion
        // --- Countdown management

        public override void OnLobbyServerPlayersReady()
        {
            int  blueteam = 0;
            int  redteam  = 0;
            bool allready = true;

            for (int i = 0; i < lobbySlots.Length; ++i)
            {
                if (lobbySlots[i] != null)
                {
                    allready &= lobbySlots[i].readyToBegin;
                }
                if (lobbySlots [i] != null)
                {
                    if ((lobbySlots [i] as LobbyPlayer).colorButton.image.color == Color.blue)
                    {
                        ++blueteam;
                    }
                    else if ((lobbySlots [i] as LobbyPlayer).colorButton.image.color == Color.red)
                    {
                        ++redteam;
                    }
                }
            }
            if (allready)
            {
                int roirouge = Random.Range(1, redteam);
                int roibleu  = Random.Range(1, blueteam);
                int tmpred   = 0;
                int tmpblue  = 0;
                Debug.Log("Les rois a trouver sont " + redteam + blueteam);
                for (int p = 0; p < lobbySlots.Length; ++p)
                {
                    Debug.Log("dans la boucle");
                    if (lobbySlots[p] != null)
                    {                    //there is maxPlayer slots, so some could be == null, need to test it before accessing!
                        Debug.Log("dans le if non nul");
                        if ((lobbySlots [p] as LobbyPlayer).colorButton.GetComponent <Image>().color == Color.blue)
                        {
                            ++tmpblue;
                            Debug.Log("joueur bleu numero " + tmpblue);
                            if (tmpblue == roibleu)
                            {
                                (lobbySlots [p] as LobbyPlayer).RpcisKingCountdown(true);
                            }
                        }
                        if ((lobbySlots [p] as LobbyPlayer).colorButton.GetComponent <Image>().color == Color.red)
                        {
                            ++tmpred;
                            Debug.Log("joueur rouge numero " + tmpred + "joueur rouge a trouver " + roirouge);
                            if (tmpred == roirouge)
                            {
                                Debug.Log("dans le tmpred==roirouge");
                                LobbyPlayer t = lobbySlots[p] as LobbyPlayer;
                                t.RpcisKingCountdown(true);
                            }
                        }
                    }
                }
                StartCoroutine(ServerCountdownCoroutine());
            }
        }
コード例 #11
0
ファイル: LobbyManager.cs プロジェクト: tdm1223/WildLife
        public void RemovePlayer(LobbyPlayer player)
        {
            Audio.Play("Click");

            player.RemovePlayer();
        }
コード例 #12
0
 public int GetPlayerIndex(LobbyPlayer player)
 {
     return(_players.IndexOf(player));
 }