Now if we want we could go back to Unity and test out this script to make sure it is working. :(") ĭebug.LogError("Here's some debug information:") ĭebug.LogError(error.GenerateErrorReport()) Private void OnLoginFailure(PlayFabError error)ĭebug.LogWarning("Something went wrong with your first API call.
Private void OnLoginSuccess(LoginResult result)ĭebug.Log("Congratulations, you made your first successful API call!") PlayFabClientAPI.LoginWithCustomID(request, OnLoginSuccess, OnLoginFailure) If (string.IsNullOrEmpty(PlayFabSettings.TitleId))
Note: Setting title Id here can be skipped if you have set the value in Editor Extensions already. Public class PlayFabLogin : MonoBehaviour Once inside our script we will replace the start and update function with the script that can be found in the PlayFab Documentation link above or as I have pasted it here: using PlayFab We will then open our script in Visual Studio. We can add this to a new folder called scripts and we will call it PlayFabLogin. To get started we will first create a new C# script. Welcome back to infoGamer, After this lesson you should have a working registration and login system for your game. SUBSCRIBE for regular Video Game making videos: If they haven’t logged in to your game before then the code in this tutorial register the player automatically. Players will be able to register and log in to your game using an email and password.
I will teach you how to allow the users of your game login to there PlayFab account for your game. We will continue our series on how to use PlayFab in Unity 3D.