void Update() { switch (currentState) { case EXECUTOR_STATE.IDLE: break; case EXECUTOR_STATE.DAY_TRANSITION: break; case EXECUTOR_STATE.NODE_TRANSITION: if (preActionIndex < currentPreAction.obtainedListOfPreAction().Count) { if (hasFinishedCurrentPreAction) { KeyValuePair <DialoguePreAction.ACTION, int> nextAction = currentPreAction.obtainedListOfPreAction() [preActionIndex++]; DialoguePreAction.ACTION actionType = nextAction.Key; int pointer = nextAction.Value; switch (actionType) { case DialoguePreAction.ACTION.CHANGE_BACKGROUND: BackgroundManager.BACKGROUND_IMAGE bImage = (BackgroundManager.BACKGROUND_IMAGE)pointer; this.uiManager.setBackgroundImage(bImage); break; case DialoguePreAction.ACTION.SHOW_SPRITE: break; case DialoguePreAction.ACTION.HIDE_SPRITE: break; case DialoguePreAction.ACTION.FADE_IN: Debug.Log("fading in"); this.uiManager.startFadeIn(); this.hasFinishedCurrentPreAction = false; break; case DialoguePreAction.ACTION.FADE_OUT: this.uiManager.startFadeOut(); this.hasFinishedCurrentPreAction = false; break; case DialoguePreAction.ACTION.PLAY_BGM: SoundManagerScript.BGM_TYPE bgmType = (SoundManagerScript.BGM_TYPE)pointer; SoundManagerScript.instance.playBGM(bgmType, true); break; case DialoguePreAction.ACTION.PLAY_SFX: Debug.Log("playing sfx"); SoundManagerScript.SFX_TYPE sfxType = (SoundManagerScript.SFX_TYPE)pointer; Debug.Log(sfxType); SoundManagerScript.instance.playSFX(sfxType); break; case DialoguePreAction.ACTION.SHOW_DIALOGUE_BAR: Debug.Log("showing dialogue bar"); this.uiManager.setDialogueBoxAnimation(DialogueAnimationController.BAR_MOVEMENT.BRING_UP); break; case DialoguePreAction.ACTION.SHOW_DIALOGUE_BAR_INSTANT: this.uiManager.setDialogueBoxAnimation(DialogueAnimationController.BAR_MOVEMENT.UP_INSTANT); break; case DialoguePreAction.ACTION.HIDE_DIALOGUE_BAR: this.uiManager.setDialogueBoxAnimation(DialogueAnimationController.BAR_MOVEMENT.BRING_DOWN); break; case DialoguePreAction.ACTION.HIDE_DIALOGUE_BAR_INSTANT: this.uiManager.setDialogueBoxAnimation(DialogueAnimationController.BAR_MOVEMENT.DOWN_INSTANT); break; } } Debug.Log("yellow"); hasFinishedCurrentPreAction = this.uiManager.hasFinishedFading(); } if (this.uiManager.hasFinishedDialogueAnimation() && preActionIndex >= currentPreAction.obtainedListOfPreAction().Count) { currentState = EXECUTOR_STATE.IDLE; this.uiManager.updateDisplayWithCurrentNode(this.currentNode); } break; } }
public void setBackgroundImage(BackgroundManager.BACKGROUND_IMAGE image) { this.ImageBackgroundManager.updateBackgroundImage(image); }