Пример #1
0
    public async void JoinOrCreateRoom()
    {
        leaveLastRoom();
        this.room = await client.JoinOrCreate <GameState>("GameRoom");

        readMessages();
        setListeners();


        this.gameObject.name += " [" + this.room.SessionId + "]";
    }
Пример #2
0
    public async void joinRoom(string id)
    {
        if (this.room != null)
        {
            if (this.room.Id != id)
            {
                leaveLastRoom();
                this.room = await client.JoinById <GameState>(id);

                name = this.room.Name;

                setListeners();
            }
        }
        else
        {
            this.room = await client.JoinById <GameState>(id);

            setListeners();
        }
    }
Пример #3
0
    async void join()
    {
        this.room = await client.Join <WorldState>("MapsRoom");

        StartCoroutine(startSending());
    }