Sudan. kgm เปลี่ยนข้อความ

รหัสตัวอย่าง

9
0

sudan. kgm เปลี่ยนข้อความ

// To change text of a text UI element use th combination below
textGameObject.GetComponent<UnityEngine.UI.Text>().text = "text";
8
0

sudan. kgm ตั้งค่าข้อความ

//Because the Text variable is public, 
//you will have to drag the Text box object onto the script in unity.
//So unity knows what text box to apply the script to.

public Text myText;
myText.text = "Enter the text value here!";

By: Barry Cox
1
0

sudan. kgm ยังไงเพื่อเปลี่ยนข้อความในสคริปต์

Text myText = GameObject.Find("Canvas/Text").GetComponent<Text>();
myText.text = "Your text changed!";

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................