Beispiel #1
0
    public void GetRoomsList()
    {
        for (int i = 0; i < RoomsInList.Count; i++)
        {
            Destroy(RoomsInList[i]);
        }

        Message.RoomsList getList = new Message.RoomsList();
        Networking_client.net.Send(Networking_msgType.RoomsListGet, getList);
    }
Beispiel #2
0
    void HandlerLoadRoomsList(NetworkMessage netMsg)
    {
        Message.RoomsList list = netMsg.ReadMessage <Message.RoomsList>();

        foreach (RoomStr r in list.Rooms)
        {
            goTemp = Instantiate(Room);
            RoomData data = goTemp.GetComponent <RoomData>();
            data.SetRoomData(r.index, r.map, r.name, r.players, r.maxPlayers, r.password);
            goTemp.transform.SetParent(RoomsList, false);

            RoomsInList.Add(goTemp);
        }
    }