public override void PushEditObjectToNGUIObject() { //the start menu automatically un-pauses a manual pause //a little weird but it feels right in game GUIManager.ManuallyPaused = false; if (Profile.Get.Current.HasLastPlayedGame) { EditObject.EnableContinueButton = true; } else { EditObject.EnableContinueButton = false; } EditObject.EnableOptionsButton = true; EditObject.EnableQuitButton = true; EditObject.EnableSaveButton = false; GameManager.SetState(EditObject.EnterGameState); PrimaryInterface.MinimizeAll(); //since we're pulling up the start menu, which will cause a pause //WHY NOT CALL THE GC? System.GC.Collect(); if (!Profile.Get.CurrentPreferences.HideDialogs.Contains("HideAllFocusUpdates") && !Profile.Get.CurrentPreferences.HideDialogs.Contains(GameManager.FocusOnSubject)) { GameObject editor = GUIManager.SpawnNGUIChildEditor(gameObject, GUIManager.Get.Dialog("NGUIThisWeekFocusDialog")); } #if UNITY_EDITOR VRMode = VRManager.VRMode | VRManager.VRTestingMode; #else VRMode = VRManager.VRMode; #endif RefreshChangeLog(); RefreshButtons(); //now see if the edit object asked for any clicks or tabs if (EditObject.ClickedOptions) { if (!string.IsNullOrEmpty(EditObject.TabSelection)) { GUIOptionsDialog optionsDialog = OnClickOptionsButton(); optionsDialog.Tabs.DefaultPanel = EditObject.TabSelection; optionsDialog.Tabs.SetSelection(EditObject.TabSelection); } } }
public GUIOptionsDialog OnClickOptionsButton() { if (mDestroyed) { return(null); } GameObject dialog = GUIManager.SpawnNGUIChildEditor(gameObject, GUIManager.Get.NGUIOptionsDialog, false); GUIManager.SendEditObjectToChildEditor <PlayerPreferences>(new ChildEditorCallback <PlayerPreferences>(OptionsDialogCallback), dialog, Profile.Get.CurrentPreferences); GUIOptionsDialog optionsDialog = dialog.GetComponent <GUIOptionsDialog>(); DisableInput(); return(optionsDialog); }
protected void ControlDialogCallback(YesNoCancelDialogResult editObject, IGUIChildEditor <YesNoCancelDialogResult> childEditor) { if (mDestroyed) { return; } GUIManager.ScaleDownEditor(childEditor.gameObject).Proceed(true); //if the result is yes, open up the options dialog if (editObject.Result == DialogResult.Yes) { GUIOptionsDialog optionsDialog = OnClickOptionsButton(); optionsDialog.Tabs.DefaultPanel = "Controls"; optionsDialog.Tabs.SetSelection("Controls"); } else { EnableInput(); } }