private void ProgressNotification(bool isLastWell) { game.ChangeStateCutScene(); StartCoroutine(WaitToPlayClip()); IEnumerator WaitToPlayClip() { yield return(new WaitForSeconds(beforePlaySecretSFXWaitTime)); // Play Correct Partial Progress SFX if is correct well but not done yet. Play Secret SFX when done. if (isLastWell) { GetComponent <AudioSource>().PlayOneShot(Script_SFXManager.SFX.Secret, Script_SFXManager.SFX.SecretVol); } else { GetComponent <AudioSource>().PlayOneShot( Script_SFXManager.SFX.CorrectPartialProgress, Script_SFXManager.SFX.CorrectPartialProgressVol ); } yield return(new WaitForSeconds(afterPlaySecretSFXWaitTime)); game.ChangeStateInteract(); if (isLastWell) { CompleteState(); } } }
/// <summary> /// NOTE: Ensure this happens before other cut scenes if any in rooms /// in Awake or After Init functions. /// </summary> public void PlayMapNotification( string mapName, Action cb = null, bool isInteractAfter = true ) { game.ChangeStateCutScene(); mapNotification.Open(mapName); StartCoroutine(WaitToEndNotification()); IEnumerator WaitToEndNotification() { yield return(new WaitForSeconds(duration)); mapNotification.Close(() => { if (isInteractAfter) { game.ChangeStateInteract(); } if (cb != null) { cb(); } }); } }
public void OnDayNotificationDone() { if (isInteractAfter) { game.ChangeStateInteract(); } isInteractAfter = true; if (onTimelineDoneAction != null) { onTimelineDoneAction(); onTimelineDoneAction = null; } }