asadm / playroom-unity

9 stars 1 forks source link

Supporting System.Serialize Types. #36

Closed momintlh closed 5 months ago

momintlh commented 5 months ago

This is how I used it:

Vector3 pos = playerGameObjects[index].GetComponent<Transform>().position;
players[index].SetState("posX", pos);

and to get:

 var newPos = players[i].GetState<Vector3>("posX");
 Debug.Log(newPos);

Result of Test build: image

shows vector3 position of the player.

These changes didn't break anything else (currently only tested with Vector3).

Should resolve #32 and #20.

SaadBazaz commented 5 months ago

Merging for a new release in SDK.