コード例 #1
0
 private void WebGameCleanPlayersList()
 {
     foreach (Transform child in WebGamePlayersContainer.transform)
     {
         PlayersContainerScript playersContainerScript = child.GetComponent <PlayersContainerScript>();
         Color color;
         if (playersContainerScript.TryGetColor(out color))
         {
             _playerColorsHelper.PutColorBack(color);
         }
         Destroy(child.gameObject);
     }
 }
コード例 #2
0
        private List <Color> GetPlayersColors()
        {
            var colors = new List <Color>();

            foreach (Transform child in WebGamePlayersContainer.transform)
            {
                PlayersContainerScript playersContainerScript = child.GetComponent <PlayersContainerScript>();
                if (playersContainerScript.Type.In(PlayerType.LocalPlayer, PlayerType.RemotePlayer))
                {
                    Color color;
                    if (playersContainerScript.TryGetColor(out color))
                    {
                        colors.Add(color);
                    }
                }
            }
            return(colors);
        }