public void StartPerformance(string caption_message, G20_CaptionParam caption_param = new G20_CaptionParam()) { if (isPerforming) { return; } StartCoroutine(CaptionCoroutine(caption_message, caption_param)); }
IEnumerator CaptionCoroutine(string caption_message, G20_CaptionParam caption_param) { isDisplayed = true; isPerforming = true; captionText.text = caption_message; yield return(StartCoroutine(MoveBlackBelt(true, caption_param.beltFadeDuration))); yield return(FadeCaption(true, caption_param.captionFadeDuration)); while (isDisplayed) { yield return(null); } yield return(new WaitForSecondsRealtime(caption_param.fadeOutDelay)); yield return(FadeCaption(false, caption_param.captionFadeDuration)); yield return(StartCoroutine(MoveBlackBelt(false, caption_param.beltFadeDuration))); isPerforming = false; }