做医院健康专题网站,thinkphp大型网站开发,学院网站整改及建设情况报告,沈阳男科医院在哪里作者是一名OIer,因为兴趣#xff0c;想在寒假期间开发一款文字游戏的demo。
本博客仅用作记录#xff0c;马蜂极度不符合规范。
但是#xff0c;可以用来避坑。
1.等待功能——使用的是协程函数#xff0c;且调用与常规调用函数不同。 private IEnumerator Sco(){isScoe…作者是一名OIer,因为兴趣想在寒假期间开发一款文字游戏的demo。
本博客仅用作记录马蜂极度不符合规范。
但是可以用来避坑。
1.等待功能——使用的是协程函数且调用与常规调用函数不同。 private IEnumerator Sco(){isScoelling 1;senten.text ;foreach(char letter in dialog[dires].ToCharArray()){senten.text letter;yield return new WaitForSeconds(textspeed);//等待多久}isScoelling 0;}StartCoroutine(你要用的函数);//调用
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using System;public class bplan : MonoBehaviour
{// Start is called before the first frame updatepublic TMP_Text senten;public float textspeed;string[] dialog new string[1001] ;int tot 0;void add(string a){dialog[tot] a;tot;}void Start(){TextAsset txt Resources.Load(test01) as TextAsset;//Debug.Log(txt);dialog txt.text.Split(\n);}// Update is called once per frameint dires 0;int isScoelling 0;private IEnumerator Sco(){isScoelling 1;senten.text ;foreach(char letter in dialog[dires].ToCharArray()){senten.text letter;yield return new WaitForSeconds(textspeed);}isScoelling 0;}void Update () {if (Input.GetKeyUp(KeyCode.A)isScoelling 0){dires;StartCoroutine(Sco());}}
}