asadm / playroom-unity

9 stars 1 forks source link

Mock API #7

Closed momintlh closed 11 months ago

momintlh commented 11 months ago

Breaking change

This PR brings a change in our API, where we now can call

int myKey = GetState<int>("myKey")

instead of

int myKey = GetStateInt("myKey")

Which makes the API cleaner, more scalable, manageable and easier to read.

Resolves #1

SaadBazaz commented 11 months ago

https://github.com/asadm/playroom-unity/blob/Mock-API/Assets/Scripts/PlayroomKit.cs#L121C53-L121C64 Save "testPlayer5" as a global private string in PlayroomKit.

i.e.

private static string testPlayerId = "testPlayer5";

And then reuse it wherever it exists.

SaadBazaz commented 11 months ago

Rest looks good. Great job!

SaadBazaz commented 11 months ago

https://github.com/asadm/playroom-unity/blob/Mock-API/Assets/Scripts/PlayroomKit.cs#L144 Override isStreamMode.

If Mock Mode, isStreamMode should return true if, in insertCoin, streamMode=true was passed. Else false.

SaadBazaz commented 11 months ago

We'll explore a better way to tell the user that they are in Mock Mode, in another PR. Merging for now. gg