/// <summary> /// Unity / MonoBehaviour function for GUI behaviour. /// </summary> void OnGUI() { // Some initialization behaviour can only be called from within the OnGUI function. // initialize UI early returns if it is already initialized InitializeUI(); // This menu has a local UI skin with buttons scaled up, and other touch enhancements. ApplyLocalUISkin(); AmazonGUIHelpers.BeginMenuLayout(); // Wrapping all of the menu in a scroll view allows the individual menu systems to not need to handle being off screen. scroll = GUILayout.BeginScrollView(scroll); // Display if the GameCircle plugin is ready.. AmazonGUIHelpers.CenteredLabel(string.Format(isServiceReadyLabel, AGSClient.IsServiceReady())); // If GameCircle is not initialized, display the initialization menu. if (initializationMenu.InitializationStatus != AmazonGameCircleExampleInitialization.EInitializationStatus.Ready) { initializationMenu.DrawMenu(); } else { // This button opens the generic GameCircle overlay. if (GUILayout.Button(gameCircleOverlayButtonLabel)) { AGSClient.ShowGameCircleOverlay(); } // This button opens the GameCircle sign in page. if (GUILayout.Button(gameCircleSignInButtonLabel)) { AGSClient.ShowSignInPage(); } // Once GameCircle is initialized, display all submenus, for achievements, leaderboards, and other GameCircle features. foreach (AmazonGameCircleExampleBase subMenu in gameCircleExampleMenus) { GUILayout.BeginVertical(GUI.skin.box); subMenu.foldoutOpen = AmazonGUIHelpers.FoldoutWithLabel(subMenu.foldoutOpen, subMenu.MenuTitle()); if (subMenu.foldoutOpen) { subMenu.DrawMenu(); } GUILayout.EndVertical(); } } GUILayout.EndScrollView(); AmazonGUIHelpers.EndMenuLayout(); // If the UI skin is not reverted at the end of the function, // any other OnGUI behavior might end up using the settings applied here. RevertLocalUISkin(); }
public void ShowSignInPage() { if (AGSClient.IsServiceReady()) { Debug.Log("Show sigin page Service Ready"); AGSClient.ShowSignInPage(); } else { Debug.Log("Show sigin page Service NOOOOOOT Ready"); } }
/// <summary> /// Shows the GameCircle sign in page. If GameCircle is not initialized, /// the <see cref="Initialize"/> method will be called. /// </summary> /// <param name="autoCloudLoad"> /// Whether or not cloud data should be loaded automatically when the user is successfully signed in. /// Ignored if Cloud Saving is deactivated or the user fails to sign in. /// </param> /// <param name='callback'> /// Due to differences in how the GameCircle platform handles sign in (there is no SignIn method, only Init), /// the callback will always be <c>true</c>. /// </param> public override void SignIn(bool autoCloudLoad = true, UnityAction <bool> callback = null) { if (AGSClient.IsServiceReady()) { AGSClient.ShowSignInPage(); } else { Initialize(CloudSaveEnabled, true, autoCloudLoad); } CloudOnceUtils.SafeInvoke(callback, true); }
/// <summary> /// Callback when GameCircle is initialized and ready to use. /// </summary> private void ServiceReadyHandler() { // Once the callback is received, these events do not need to be subscribed to. UnsubscribeFromGameCircleInitializationEvents(); // Tell the GameCircle plugin the popup information set here. // Calling this after GameCircle initialization is safest. // AGSClient.SetPopUpEnabled(true); // AGSClient.SetPopUpLocation(GameCirclePopupLocation.TOP_CENTER); // if(!Social.localUser.authenticated) { AGSClient.ShowSignInPage(); } // else // { // Instance.PostScoreToLeaderBoard(); // } }
public void ShowSignInPage() { #if AMAZON_CIRCLE_ENABLED AGSClient.ShowSignInPage(); #endif }