/// <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 ShowGameCircle() { if (AGSClient.IsServiceReady()) { AGSClient.ShowGameCircleOverlay(); } else { Debug.Log("Show sigin page Service NOOOOOOT Ready"); } }
/// <summary> /// Shows the Amazon GameCircle overlay. /// </summary> public void ShowNativeOverlay() { if (AGSClient.IsServiceReady()) { AGSClient.ShowGameCircleOverlay(); } else { Debug.LogWarning("Can't show native overlay. Service is not ready. Call Initialize first."); } }
public void ShowGCOverlay() { #if AMAZON_CIRCLE_ENABLED AGSClient.ShowGameCircleOverlay(); #endif }