public void Display() { GUILayout.BeginVertical(); GUILayout.Label("Attach Identity"); GUILayout.BeginHorizontal(); if (Util.Button("Universal #1")) { AttachIdentityDialog.AttachIdentityUniversal_1(); } if (Util.Button("Universal #2")) { AttachIdentityDialog.AttachIdentityUniversal_2(); } if (Util.Button("Email")) { AttachIdentityDialog.AttachIdentityEmail(); } if (Util.Button("GooglePlay (Android Only)")) { AttachIdentityDialog.AttachIdentityGooglePlay(); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); }
public static void AttachIdentityEmail() { GameObject dialogObject = new GameObject("Dialog"); AttachIdentityDialog dialog = dialogObject.AddComponent <AttachIdentityDialog>(); dialog.m_exampleAccountType = ExampleAccountType.Email; App.Bc.Client .IdentityService.AttachEmailIdentity(UtilValues.getEmail(), UtilValues.getPassword(), dialog.OnSuccess_AttachIndentity, dialog.OnError_AttachIdentity); }
public static void AttachIdentityGooglePlay() { #if UNITY_ANDROID GameObject dialogObject = new GameObject("Dialog"); AttachIdentityDialog dialog = dialogObject.AddComponent <AttachIdentityDialog>(); dialog.m_exampleAccountType = ExampleAccountType.GooglePlay; GoogleIdentity.RefreshGoogleIdentity(identity => { BrainCloudWrapper.Client.IdentityService.AttachGoogleIdentity(identity.GoogleId, identity.GoogleToken, dialog.OnSuccess_AttachIndentity, dialog.OnError_AttachIdentity); }); #else ErrorDialog.DisplayErrorDialog("AuthenticateAsGooglePlay", "You can only use GooglePlay auth on Android Devices"); #endif }