Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

The home for PlayFab's Unity Editor plugin. This plugin houses a custom inspector for viewing and configuring the PlayFab SDK.

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

kamyker/PlayFabUnityEditorExtensions

 
 

Repository files navigation

PlayFab Unity Editor Extensions

Fork with Package Manager, Assembly Definitions, async/await support

Read: Original README

⚠️ Warning - this is my custom version of official sdk, some functions may not work correctly.

Setup:

  1. 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

  1. Follow Original README from step 2.

This is how project looks like with this fork:

project

Features

Async/Await and simpler syntax

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);
}

Assembly Definitions

No recompilation of PlayFabSDK

Package Manager

Simplifies how sdks are installed, upgraded and managed. Makes it really easy to make plugins for playfab.

Tips

Fire Forget

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);
});

Other

Avoid using async void methods. Use async Task instead and run them with FireForgetLog.

About

The home for PlayFab's Unity Editor plugin. This plugin houses a custom inspector for viewing and configuring the PlayFab SDK.

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%