Read: Original README
- Open
<project_root>/Packages/manifest.json
and add
"com.playfab.editorextensions": "https://github.com/kamyker/PlayFabUnityEditorExtensions.git",
"com.playfab.shared": "https://github.com/kamyker/PlayFabUnityShared.git"
to dependencies
- Follow Original README from step 2.
This is how project looks like with this fork:
Example from playfab-unity-getting-started instead of writing this code:
var request = new LoginWithCustomIDRequest { CustomId = "GettingStartedGuide", CreateAccount = true};
PlayFabClientAPI.LoginWithCustomID(request, OnLoginSuccess, OnLoginFailure);
private void OnLoginSuccess(LoginResult result)
{
}
private void OnLoginFailure(PlayFabError error)
{
Debug.LogError(error.GenerateErrorReport());
}
You get:
try
{
var result = await ClientAPI.LoginWithCustomID("144", true, "GettingStartedGuide");
//success
}
catch(PlayFabError e)
{
Debug.LogError(e.Message);
}
No recompilation of PlayFabSDK
Simplifies how sdks are installed, upgraded and managed. Makes it really easy to make plugins for playfab.
To run any api call without awaiting it (for example logging events) use included FireForgetLog extension method:
EventsAPI.WriteEvents(some_events).FireForgetLog();
This is similar to:
Task.Run(async () =>
try
{
await EventsAPI.WriteEvents(some_events);
}
catch(Exception e)
{
Debug.LogException(e);
});
Avoid using async void
methods. Use async Task
instead and run them with FireForgetLog.