colyseus / colyseus-unity-sdk

⚔ Colyseus Multiplayer SDK for Unity
https://docs.colyseus.io/getting-started/unity-sdk/
MIT License
371 stars 102 forks source link

The code after "client.JoinOrCreate" does not execute #172

Closed tony709394 closed 3 years ago

tony709394 commented 3 years ago

Why is Debug.Log("====== JoinOrCreate ======"); always not implemented?And no exceptions are caught.

public class ExampleManager : ColyseusManager<ExampleManager>
{

    ColyseusRoom<RoomState> room;

    override
    protected async void Start()
    {
        Debug.Log("====== start ======");

        try
        {
            this.InitializeClient();
            this.room = await this.client.JoinOrCreate<RoomState>("room");
        }
        catch (Exception ex)
        {
            Debug.Log(ex);
        }

        Debug.Log("====== JoinOrCreate ======");
    }
}

version: 0.14.8

tony709394 commented 3 years ago

document: https://github.com/colyseus/colyseus-unity3d/blob/master/Assets/Colyseus/Documentation%7E/GettingStarted.md Which version does the document correspond to? I don't think it's 0.14.8. This bothered me when I tried the demo.

tony709394 commented 3 years ago

[Resolved] Because the client Schema does not correspond to the server Schema. Just use "schema-codegen" to solve the problem.