Пример #1
0
    public void CreatePlayerSlot(RoomPlayer newRoomPlayer, bool isLocal)
    {
        GameObject     roomPlayerSlotObj = Instantiate(roomPlayerSlotPrefab, playerLayoutGroup, false);
        RoomPlayerSlot roomPlayerSlot    = roomPlayerSlotObj.GetComponent <RoomPlayerSlot>();

        newRoomPlayer.AssignRoomPlayerSlot(roomPlayerSlot);
        roomPlayerSlot.Initialize(newRoomPlayer);

        if (isLocal)
        {
            roomPlayerSlot.SetAsLocal();
        }
        roomPlayers.Add(newRoomPlayer);
    }