csharp 出题文を一文字ずつ表示する。タイピング音も鸣らす。流用できそう

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 出题文を一文字ずつ表示する。タイピング音も鸣らす。流用できそう相关的知识,希望对你有一定的参考价值。

    // 出題文を表示する
    private void ShowQuestion ()
    {
        StartCoroutine ( DoShowQuestion () );
    }

    private IEnumerator DoShowQuestion ()
    {
        var question = questions[questionNumber][0];

        var length = question.Length; // 出題文の文字数
        var counter = 0;

        while ( counter < length )
        {
            questionText.text += question.ElementAt ( counter );
            typingAudioSource.Play ();
            counter++;
            yield return new WaitForSeconds ( questionCharDisplaySpan );
        }
    }

以上是关于csharp 出题文を一文字ずつ表示する。タイピング音も鸣らす。流用できそう的主要内容,如果未能解决你的问题,请参考以下文章