コード例 #1
0
    IEnumerator CoToggleLetterUI(bool toggle)
    {
        if (toggle)
        {
            isLetterUsable = false;

            letterUICanvas.gameObject.SetActive(true);
            for (int i = 0; i < letterGraphics.Length; i++)
            {
                letterGraphics[i].CrossFadeAlpha(0, 0, false);
            }

            DialogueManager.BroadcastOnConversationStart();

            isLetterUIActive = true;
            for (int i = 0; i < letterGraphics.Length; i++)
            {
                letterGraphics[i].CrossFadeAlpha(1, fadeDuration, false);
            }

            yield return(new WaitForSeconds(fadeDuration));

            isLetterUsable = true;
        }
        else
        {
            isLetterUIActive = false;
            isLetterUsable   = false;

            for (int i = 0; i < letterGraphics.Length; i++)
            {
                letterGraphics[i].CrossFadeAlpha(0, fadeDuration, false);
            }

            yield return(new WaitForSeconds(fadeDuration));

            DialogueManager.BroadcastOnConversationEnd();

            letterUICanvas.gameObject.SetActive(false);

            isLetterUsable = true;
        }
    }