public void AnimateMenuExit() { //TODO: hack fix sometimes mediator is still there after the gameobject has been destroyed by Unity if (View != null) { View.StartExitAnimation(() => SceneMenuStateExitAnimationEndedSignal.Dispatch()); if (MenuState.ExitBGM != BibaBGM.None) { PlayBibaBGMSignal.Dispatch(MenuState.ExitBGM); } if (MenuState.ExitSFX != BibaSFX.None) { PlayBibaSFXSignal.Dispatch(MenuState.ExitSFX); } } }
void ShowObjectBasedMenuState(ObjectMenuState menuState, bool status) { if (this != null && menuState.MenuStateGameObject != null && menuState.SceneName == this.name) { if (status) { if (menuState.EnterBGM != BibaBGM.None) { PlayBibaBGMSignal.Dispatch(menuState.EnterBGM); } if (menuState.EnterSFX != BibaSFX.None) { PlayBibaSFXSignal.Dispatch(menuState.EnterSFX); } BaseObjectMenuStateView.AnimateEntry(); MenuStateObjectEnabled(); } else { if (menuState.ExitBGM != BibaBGM.None) { PlayBibaBGMSignal.Dispatch(menuState.ExitBGM); } if (menuState.ExitSFX != BibaSFX.None) { PlayBibaSFXSignal.Dispatch(menuState.ExitSFX); } BaseObjectMenuStateView.AnimateExit(); MenuStateObjectDisabled(); } } }