/// <summary> /// Toggle game panel and go to display state /// </summary> /// <returns></returns> private IEnumerator TransitionToDisplay() { yield return(new WaitForSeconds(3.0f)); stateMachine.TriggerHUDEvent(UIEvents.Type.ToggleGamePanel, HUD.VisibleToggle.Display.ToString()); yield return(new WaitForSeconds(1.0f)); stateMachine.ChangeState(GameplayStateMachine.GameplayState.Display); }
public void Begin() { //init generate combination stateMachine.GenerateCombination(); //UI stateMachine.TriggerHUDEvent(UIEvents.Type.InitProgressWidget, stateMachine.GetGameBlueprint().combinationCount.ToString()); //GO TO INTRO STATE stateMachine.ChangeState(GameplayStateMachine.GameplayState.Intro); }
private IEnumerator FadeOutNumbers() { //wait a second to give the user time yield return(new WaitForSeconds(3f)); //remove numbers on UI stateMachine.TriggerHUDEvent(UIEvents.Type.RemoveCombination, combinationFadeOutTime.ToString()); //fade out combination yield return(new WaitForSeconds(combinationFadeOutTime)); //TO INPUT STATE stateMachine.ChangeState(GameplayStateMachine.GameplayState.Input); }
private IEnumerator IntroSequence() { yield return(new WaitForSeconds(cameraInWaitTime)); //bring in camera stateMachine.TriggerGameplayEvent(GameplayEvent.Type.CameraChange, GameplayCamera.LocationKey.Main.ToString()); //bring in Game Panel yield return(new WaitForSeconds(cameraInWaitTime)); stateMachine.TriggerHUDEvent(UIEvents.Type.ToggleGamePanel, HUD.VisibleToggle.Display.ToString()); yield return(new WaitForSeconds(cameraInWaitTime)); //Lets tsart the game stateMachine.ChangeState(GameplayStateMachine.GameplayState.Display); }
private IEnumerator ChangeState(GameplayStateMachine.GameplayState nextState) { if (nextState == GameplayStateMachine.GameplayState.GameOver) { yield return(UpdateHighScoreGameplay()); } //wait a second to give the user time yield return(new WaitForSeconds(1.5f)); //remove numbers on UI stateMachine.TriggerHUDEvent(UIEvents.Type.RemoveCombination, combinationFadeOutTime.ToString()); //fade out combination yield return(new WaitForSeconds(combinationFadeOutTime)); //TO Next State stateMachine.ChangeState(nextState); }
/// <summary> /// when the replay game button is selected /// </summary> /// <param name="message"></param> private void ReplayGame(string message) { stateMachine.PlaySound(AudioFiles.UISoundClip.CartoonPop); stateMachine.ChangeState(GameplayStateMachine.GameplayState.Replay); }