protected virtual void OnYes() { LoadFileScreen screenComp = parentScreen.GetComponent <LoadFileScreen>(); ScreenQueueManager.GetInstance().ClearQueueAndDestroyAllScreens(); screenComp.Close(); }
public void OnLoadCompleteEvent(EventTypeEnum type, object obj) { EventController.GetInstance().UnregisterForEvent( EventTypeEnum.AssetsLoadMultipleComplete, OnLoadCompleteEvent); ScreenQueueManager.GetInstance().ClearQueueAndDestroyAllScreens(); DialogController.GetInstance().StartConversation(); }
private void StartNewGame() { Debug.Log("Start New Game"); // Add it to the title game object GameObject MainMenu = GameObject.Find(GameConstants.UI_MAIN_MENU); GameObject saveFileScreen = UIFactory.CreateScreen(UIFactory.SCR_SAVE_FILE, MainMenu); ScreenQueueManager sqm = ScreenQueueManager.GetInstance(); sqm.QueueScreenAsNext(saveFileScreen); sqm.QueueScreen(this.gameObject); }
protected override void OnYes() { // Set the current save slot PlayerAccountManager.GetInstance().CurrSaveSlot = SlotNum; Debug.Log("SaveFile Yes"); // Pop the name input screen GameObject MainMenu = GameObject.Find(GameConstants.UI_MAIN_MENU); GameObject nameInputScreen = UIFactory.CreateScreen(UIFactory.SCR_NAME_INPUT, MainMenu); ScreenQueueManager sqm = ScreenQueueManager.GetInstance(); sqm.QueueScreenAsNext(nameInputScreen); sqm.QueueScreen(parentScreen); }
private void OnContinueClicked() { if (!isActive) { return; } // Add it to the title game object GameObject MainMenu = GameObject.Find(GameConstants.UI_MAIN_MENU); GameObject loadFileScreen = UIFactory.CreateScreen(UIFactory.SCR_LOAD_FILE, MainMenu); ScreenQueueManager sqm = ScreenQueueManager.GetInstance(); sqm.ShowScreenNow(loadFileScreen); sqm.QueueScreenAsNext(this.gameObject); }
protected override void OnClicked() { Debug.Log("Save File Button Clicked"); GameObject MainMenu = GameObject.Find(GameConstants.UI_MAIN_MENU); ConfirmScreen screenComp = UIFactory.CreateScreenAndAddComponent <ConfirmScreen>(UIFactory.SCR_CONFIRM, MainMenu); ScreenQueueManager sqm = ScreenQueueManager.GetInstance(); sqm.ShowScreenNow(screenComp.gameObject); sqm.QueueScreenAsNext(parentScreen); screenComp.SetData(UIConstants.SAVE_FILE_TITLE, UIConstants.SAVE_FILE_DESC, OnYes, OnNo); SoundEffectController.GetInstance().PlaySound(GameConstants.SND_BUTTON); }
// Use this for initialization public override void Start() { base.Start(); // This guy is not closeable from the Screen Queue since it is the title screen base.isCloseable = false; ScreenQueueManager.GetInstance().ShowScreenNow(this.gameObject); anim = GetComponent <Animator>(); newGameBtn = UIUtils.GetButtonByName(this.gameObject, BTN_NEWGAME); newGameBtn.onClick.AddListener(OnNewGameClicked); continueBtn = UIUtils.GetButtonByName(this.gameObject, BTN_CONTINUE); continueBtn.onClick.AddListener(OnContinueClicked); LoadMusic(); }
private void OnNewGameClicked() { if (!isActive) { return; } // Add it to the title game object GameObject MainMenu = GameObject.Find(GameConstants.UI_MAIN_MENU); ConfirmScreen confirmScreen = UIFactory.CreateScreenAndAddComponent <ConfirmScreen>(UIFactory.SCR_CONFIRM, MainMenu); confirmScreen.SetData(UIConstants.NEW_GAME_TITLE, UIConstants.NEW_GAME_DESC, StartNewGame, null); ScreenQueueManager sqm = ScreenQueueManager.GetInstance(); sqm.ShowScreenNow(confirmScreen.gameObject); sqm.QueueScreenAsNext(this.gameObject); }
/// <summary> /// Begins a conversation and opens up the ConversationScreen. /// </summary> public void StartConversation() { if (currConv == null) { Debug.LogError("Cannot start a conversation if one was not loaded."); return; } Debug.Log("Start Conversation: " + currConv.uid); GameObject MainMenu = GameObject.Find(GameConstants.UI_MAIN_MENU); GameObject convScreenObj = UIFactory.CreateScreen(UIFactory.SCR_CONVERSATION, MainMenu); currNode = currConv.nodeMap[currConv.startNodeTitle]; // Set the node to be displayed upon loading to the starting node ApplyParamModifiers(currNode); ScreenQueueManager sqm = ScreenQueueManager.GetInstance(); sqm.ShowScreenNow(convScreenObj); }
private void ApplyParamModifiers(ConversationNode node) { if (node.paramMods == null || node.paramMods.Count < 1) { return; } PlayerAccountManager pm = PlayerAccountManager.GetInstance(); Player player = pm.GetPlayer(); for (int i = 0, count = node.paramMods.Count; i < count; i++) { ConversationParamModifier mod = node.paramMods[i]; // If it's a music parameter then play the transition if (ParameterModifierUtils.IsMusicParameter(mod.paramName)) { if (mod.paramName == MusicController.DIALOG_PARAM_MUSIC_FADEIN) { MusicController.GetInstance().TransitionToNewSong(mod.strValue); } if (mod.paramName == MusicController.DIALOG_PARAM_MUSIC_FADEOUT) { MusicController.GetInstance().FadeOutCurrentSong(); } continue; } if (ParameterModifierUtils.IsScreenParameter(mod.paramName)) { if (mod.paramName == PMOD_SCREEN_QUEUE) { GameObject MainMenu = GameObject.Find(GameConstants.UI_MAIN_MENU); GameObject screen = UIFactory.CreateScreen(mod.strValue, MainMenu); ScreenQueueManager.GetInstance().QueueScreen(screen); } continue; } if (ParameterModifierUtils.IsMapParameter(mod.paramName)) { // Preload a map if (mod.paramName == PMOD_MAP_PRELOAD) { MapController.GetInstance().LoadMapByUID(mod.strValue); } if (mod.paramName == PMOD_MAP_SHOW) { MapController.GetInstance().ShowMap(); } continue; } // Set the string or integer to the given value. if (mod.action == ConversationParamModifier.ModifierActionType.Set) { if (mod.type == ConversationParamModifier.ModifierType.Integer) { player.SetValue <int>(mod.paramName, mod.intValue); } else { player.SetValue <string>(mod.paramName, mod.strValue); } continue; } if (mod.action == ConversationParamModifier.ModifierActionType.Increment) { player.IncrementValue(mod.paramName, mod.intValue); continue; } if (mod.action == ConversationParamModifier.ModifierActionType.Decrement) { player.IncrementValue(mod.paramName, -mod.intValue); continue; } } // Save the player progress at this point. pm.AutoSavePlayerToCurrentSlot(); }
public void OnApplicationQuit() { ScreenQueueManager.GetInstance().ClearQueueAndDestroyAllScreens(); }
public virtual void OnDestroy() { ScreenQueueManager.GetInstance().ShowNextScreen(); }