예제 #1
0
 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;
 }
예제 #2
0
 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;
         }
     }
 }
예제 #3
0
        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);
        }
예제 #4
0
 public void SetInactive()
 {
     Name     = "";
     SlotType = LobbySlotType.Inactive;
 }
예제 #5
0
 public void SetAddPlayer()
 {
     Name     = "";
     SlotType = LobbySlotType.Free;
 }
예제 #6
0
 public LobbySlot(int id, LobbySlotType slotType)
 {
     Id       = id;
     SlotType = slotType;
     Name     = "";
 }