第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

使文本網(wǎng)格中的文本停留幾秒鐘

使文本網(wǎng)格中的文本停留幾秒鐘

C#
海綿寶寶撒 2023-07-22 18:27:50
我想顯示我的文本 3 秒鐘,所以我做了以下操作,但它只是閃爍并消失。  void Start () {        Invoke("ShowInfoText", 2f);    }void ShowInfoText(){    infoText.gameObject.SetActive(true);    infoText.text = "Welocme!";    Invoke("DisableInfoText", 5f);}void DisableInfoText(){    infoText.gameObject.SetActive(false);}如何讓文字停留3秒?
查看完整描述

1 回答

?
哆啦的時(shí)光機(jī)

TA貢獻(xiàn)1779條經(jīng)驗(yàn) 獲得超6個(gè)贊

你可以試試InvokeRepeating。


public void InvokeRepeating(string methodName, float time, float RepeatRate );


您還可以使用協(xié)程:


void Start ()

{

    StartCoroutine(DoTextShow());

}


IEnumerator DoTextShow()

{

    infoText.gameObject.SetActive(false);

    yield return new WaitForSeconds(2f);

    infoText.gameObject.SetActive(true);

    yield return new WaitForSeconds(3f);

    infoText.gameObject.SetActive(false);

}


查看完整回答
反對(duì) 回復(fù) 2023-07-22
  • 1 回答
  • 0 關(guān)注
  • 138 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)