public void SetActive(string name, Color c, LobbySlotType type, ulong clientId) { Name = name; SlotType = type; ColorR = c.r; ColorG = c.g; ColorB = c.b; ClientId = clientId; }
public void FillNextFreeSlot(string name, Color c, LobbySlotType slotType, ulong clientId = 0) { foreach (UI_LobbySlot uiSlot in UiSlots) { if (uiSlot.Slot.SlotType == LobbySlotType.Free || uiSlot.Slot.SlotType == LobbySlotType.Inactive) { uiSlot.SetActive(name, c, slotType, clientId); break; } } }
public void SetActive(string playerName, Color c, LobbySlotType type, ulong clientId) { Slot.SetActive(playerName, c, type, clientId); AddPlayerPanel.SetActive(false); ActivePanel.SetActive(true); PlayerText.text = playerName; PlayerText.color = c; PlayerColor.color = c; bool canChangeColor = Slot.ClientId == NetworkPlayer.LocalClientId; PlayerColorButton.enabled = canChangeColor; bool canRemove = Slot.SlotType == LobbySlotType.Bot && (Lobby.Type == GameType.Singleplayer || NetworkManager.Singleton.IsHost); RemovePlayerButton.gameObject.SetActive(canRemove); }
public void SetInactive() { Name = ""; SlotType = LobbySlotType.Inactive; }
public void SetAddPlayer() { Name = ""; SlotType = LobbySlotType.Free; }
public LobbySlot(int id, LobbySlotType slotType) { Id = id; SlotType = slotType; Name = ""; }