так что я хочу получить строку текста в другой сцене, но после того, как я попробовал сам, не работает, я делаю это неправильно?
здесь Google Сценарий подписи в этом сценарии. Я хочу сохранить строку task.result.displayName
с помощью Playerprefs
internal void OnAuthenticationFinished(Task<GoogleSignInUser> task)
{
if (task.IsFaulted)
{
using (IEnumerator<Exception> enumerator = task.Exception.InnerExceptions.GetEnumerator())
{
if (enumerator.MoveNext())
{
GoogleSignIn.SignInException error = (GoogleSignIn.SignInException)enumerator.Current;
AddToInformation("Got Error: " + error.Status + " " + error.Message);
}
else
{
AddToInformation("Got Unexpected Exception?!?" + task.Exception);
}
}
}
else if (task.IsCanceled)
{
AddToInformation("Canceled");
}
else
{
AddToInformation("Welcome: " + task.Result.DisplayName + "!");
AddToInformation("Email = " + task.Result.Email);
AddToInformation("Google ID Token = " + task.Result.IdToken);
AddToInformation("Email = " + task.Result.Email);
SignInWithGoogleOnFirebase(task.Result.IdToken);
currEmail = task.Result.DisplayName;
PlayerPrefs.SetString("Username " + currEmail, currEmail);
Debug.Log(currEmail);
}
private void AddToInformation(string str) { infoText.text += "\n" + str; }
, после чего я хочу вызвать Playerprefs.GetString
в другой сцене с прикреплением к тексту
* 1010. *
но почему это не работает, для вашей информации я не использую DontDestroyOnload on google sign script so I attach on a sign in the scene and main menu scene