To get started with PlayFab in Unity, all you need is to follow these two simple steps. The first step is that you set up your PlayFab account. The second step is to connect it to Unity by installing the Unity Editor Extensions. Alternatively, you can also download the PlayFab SDK and configure it without the extension.
Setting Up Your PlayFab Account
Visit PlayFab’s website and create your account.
Create a New Studio. Note that once you create it, you cannot delete the studio. You can change the default title to whatever you want.
Add PlayFab to Unity with PlayFab Unity Editor Extensions
The PlayFab Unity Editor Extensions did not work for me using my Microsoft account. Maybe you will have more luck. To be on the safe side, when using the extension, sign in with your email and password.
Download the PlayFab Unity Editor Extensions Asset Package from here.
After you have imported the files, you will see a sub-folder under your Assets called PlayfabEditorExtensions. A new PlayFab Extensions window comes up in the Unity Editor (you can also find this under Window > PlayFab > Editor Extensions).
Click on “LOG IN” and add your PlayFab username and password.
You will see “No SDK is installed”. Click on “Install PlayFab SDK”.
When you are done with the SDK installation, your Project View will contain both the PlayFabEditorExtensions and the PlayFabSDK.
Next, you need to set your title. Click on “SET MY TITLE”.
Note: you will use your TitleId and not your Title. Go to PlayFab, and copy the ID of your title.
Copy this ID into the TITLE ID field of the PlayFab Window in Unity Editor.
Congratulations! Now you are ready-to-use PlayFab in Unity.
Add PlayFab to Unity Manually
It is unnecessary to use the PlayFab Unity Editor Extension. You can configure PlayFab directly and then sign in with your Microsoft account too.
Download the PlayFabUnitySDK and import the files.
Go to Assets > PlayFabSDK > Shared > Public > Resources > PlayFabSharedSettings.asset, and set the TitleId and the Developer Secret Key.
You can find the Developer Secret Key in PlayFab, by clicking on the gearwheel next to your title, and selecting Title Settings.
Using PlayFab Multiplayer Platform
If you want to implement multiplayer servers, install the PlayFab Game Server SDK (GSDK) as well. You can download it from here. To use it, don’t forget to set the ENABLE_PLAYFABSERVER_API scripting directive (Unity Editor > File > Build Settings… > Player Settings… > Other Settings > Scripting Define Symbols).