private IEnumerator DoTransition(mg_jr_Penguin _penguin, OnTransitionCompleted _completionCallback) { Assert.NotNull(_penguin, "Penguin must be provided"); Minigame miniGame = MinigameManager.GetActive(); miniGame.PlaySFX(mg_jr_Sound.UI_TURBO_MODE_START.ClipName()); m_speedLineFX.StartLines(mg_jr_SpeedLineScreenFx.LineStartMode.RANDOM_POSITION); _penguin.StartTransition(); miniGame.PlaySFX(mg_jr_Sound.PLAYER_EXPLODE.ClipName()); yield return(StartCoroutine(FlashWhite(0.1f))); yield return(new WaitForSeconds(2f)); yield return(StartCoroutine(FlashWhite(0.1f))); _penguin.EndTransition(); m_speedLineFX.StopLinesImmediately(); miniGame.PlaySFX(mg_jr_Sound.UI_TURBO_MODE_END.ClipName()); base.gameObject.SetActive(value: false); _completionCallback?.Invoke(); }
public void Transition(mg_jr_Penguin _penguin, OnTransitionCompleted _completionCallback) { base.gameObject.SetActive(value: true); StartCoroutine(DoTransition(_penguin, _completionCallback)); }