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); } }
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); }