I am trying to make a user account system for my Unity3D game. I have the basics of the UI all done, I just need the functionality to work. When I try to use "PlayFabAuthManager" following the "Unity Player Login" tutorial on YouTube, I get this error:
"error CS0246: The type or namespace name `PlayFabAuthManager' could not be found. Are you missing an assembly reference?"
Here is the YouTube video: https://www.youtube.com/watch?v=QPRqaRQ4K7g&t=1362s
Here is my code: (the problem is around line 63, and repeats on lines 154 and 160)
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System.IO; using System.Text; using System.Security.Cryptography; using PlayFab; using PlayFab.ClientModels; using PlayFab.Events; public class Register : MonoBehaviour { public GameObject username; public GameObject email; public GameObject password; public GameObject confPassword; public string Username; public string Email; public string Password; public string ConfPassword; public string form; private bool emailValid = true; public string path = @"C:\AccountInformation\"; public string key; public Text LogInErrorText; public enum LinkTypes { PlayFab = 0, Facebook = 1, Google = 2, Steam = 3, Kongregate = 4, Custm = 5, Ios = 6, Android = 7, None = -1 }; public string TitleId; public static UserAccountInfo AccountInfo; public WebRequestType PlayFabRequestType = WebRequestType.HttpWebRequest; public delegate void PlatformCheckCompleteHandler (LinkTypes linkType); public static event PlatformCheckCompleteHandler OnPlatformCheckComplete; public delegate void PlayFabReturnPlayerCheckCompleteHandler (LinkTypes linkType); public static event PlayFabReturnPlayerCheckCompleteHandler OnReturnPlayerCheckComplete; public delegate void PlayFabAuthenticationCompleteHandler (LinkTypes linkType, LoginResult result); public static event PlayFabAuthenticationCompleteHandler OnPlayFabAuthComplete; public delegate void PlayFabAuthenticationErrorHandler (LinkTypes linkType, LoginResult result); public static event PlayFabAuthenticationErrorHandler OnPlayFabAuthError; public static PlayFabAuthManager Instance { get; private set; } void Start () { } void Update () { Username = username.GetComponent<InputField> ().text; Password = password.GetComponent<InputField> ().text; Email = email.GetComponent<InputField> ().text; ConfPassword = confPassword.GetComponent<InputField> ().text; PlayFabSettings.TitleId = TitleId; } public void RegisterButton () { Debug.Log ("Attempting"); bool UN = false; bool EM = false; bool PW = false; bool CPW = false; if (Username == "") { Debug.Log ("Username field empty"); } else { if (File.Exists (path + Username + ".txt")) { Debug.Log ("Username taken"); } else { UN = true; } } if (Password == "") { Debug.Log ("Password field empty"); } else { key = Password; //Password = Encrypt (Password); PW = true; } if (ConfPassword == "") { Debug.Log ("Confirm pass field empty"); } else { if (ConfPassword != Password) { Debug.Log ("Passwords don't match"); } else { CPW = true; } } if (Email == "") { Debug.Log ("Email field empty"); } else { if (Email.Contains ("@") && Email.Contains (".")) { Email = Encrypt (Email); EM = true; } else { Debug.Log ("Email address invalid format"); } } if (UN == true && EM == true && PW == true && CPW == true) { /*string info = (Username + "\n" + Password + "\n" + Email); File.WriteAllText (path + Username + ".txt", info);*/ RegisterAccount (); } } private string Encrypt (string pass) { System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] bs = System.Text.Encoding.UTF8.GetBytes(pass); bs = x.ComputeHash(bs); System.Text.StringBuilder s = new System.Text.StringBuilder(); foreach (byte b in bs) { s.Append(b.ToString("x2").ToLower()); } return s.ToString(); } public void RegisterAccount () { var loginRequest = new LoginWithPlayFabRequest () { TitleId = PlayFabSettings.TitleId, Username = Username, Password = Password }; PlayFabClientAPI.LoginWithPlayFab (loginRequest, (result) => { LoginRegisterSuccess (result.PlayFabId); }, (error) => { LogInErrorText.text = error.ErrorMessage; LogInErrorText.gameObject.SetActive(true); PlayFabErrorHandler.HandlePlayFabError(error); }); } public void LoginRegisterSuccess (string PlayFabId){ PlayFab.PlayFabAuthManager.PlayFabId = PlayFabId; LogInErrorText.gameObject.SetActive (false); } }