iLMS知識社群歷程檔登入
位置: 黃國哲 > Unity
1090630 多個If使用
by 黃國哲 2020-06-30 22:50:30, 回應(0), 人氣(530)

IF可以同時使用多個:

 void Update()
    {
        if (Keyme.text == "abc1")
       tip.text= " Data ";

        if (Keyme.text == "abc1")        
             tip2.text=" More Data ";
  
        if (Keyme.text == "abc")
          tip.text= " 安安  ";
    }

也可以從語法裡直接對Text輸入內容:
在TEXT中輸入與下語法:
 tip2.text=" More Data ";
回應