asadm / playroom-unity

9 stars 1 forks source link

Support setState and getState of Vector2, Vector3 and Quaternion #20

Closed asadm closed 5 months ago

asadm commented 10 months ago

I should be able to SetState("pos", new Vector3(3.3f, 4.0f, 5.0f)); in both global and player states.

Also, trim all x,y,z and x,y,z,w floats to 4 decimals so they dont consume too much network bandwidth to transmit ie:

string floatToString(float f){
  return f.ToString("0.000");
}
asadm commented 10 months ago

Actually on a second thought, I think we can put these snippets in docs instead of core API.

SaadBazaz commented 10 months ago

We can add the trimming in docs, but for Vector etc we should add an overload func so that intellisense can work.

asadm commented 10 months ago

No let's keep API as-is and provide these helper snippets (to serialize Vector3 to string) in docs. I will do it.

SaadBazaz commented 10 months ago

Makes sense, will be consistent with other SDKs.

SaadBazaz commented 5 months ago

Closing this as marked as completed by #36 . Feel free to reopen otherwise.