Array handling in colyseus.

How to get array in unity from colyseus state?

0_1549602223569_image.png

hi @ahtashamabbasse, not sure if this was already replied on Discord, I'll post here anyway!

you can listen to your hand structure using something like this:

room.Listen("hands/:index/:attribute", this.OnHandChange);

// ...
void OnHandChange(DataChange change)
{
	Debug.Log(change.path["index"]);
	Debug.Log(change.path["attribute"]);
	Debug.Log("has changed to");
	Debug.Log(change.value);
}

The callback will be called for each attribute you have on each item in your array. Here's the logs I've got from this:

0_1549735199435_Screenshot 2019-02-09 at 15.54.37.png

thanks for your reply it means alot for us. We will try it.