本文整理汇总了C#中GUIText.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# GUIText.GetComponent方法的具体用法?C# GUIText.GetComponent怎么用?C# GUIText.GetComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GUIText
的用法示例。
在下文中一共展示了GUIText.GetComponent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
higthScore = PlayerPrefs.GetInt("HighScore");
CurrentScore = PlayerPrefs.GetInt("currentScore");
text = new GameObject("SomeGUIText");
Instantiate(text);
myText = text.AddComponent<GUIText>();
myText.transform.position = new Vector3(0.2f,0.2f,0f);
myText.GetComponent<GUIText> ().text = "Score: " + CurrentScore + " Meilleur score : " + higthScore;
myText.GetComponent<GUIText> ().fontSize = 100;
skin = Resources.Load("GUISkin") as GUISkin;
}
示例2: ShowItemsForSell
public void ShowItemsForSell()
{
float offsetNextItem = 0f;
for(int i = 0; i<inventory.itemList.Count; i++){
showItem = Instantiate(textItem) as GUIText;
showItem.GetComponent<ShowItemTextSell>().itemName = inventory.itemList[i].name;
showItem.text = inventory.itemList[i].name +" "+inventory.itemList[i].GetComponent<Item>().priceSell+" Gils";
showItem.transform.parent = shop;
showItem.transform.position += new Vector3(-0.4f, 0.4f-offsetNextItem,0f);
showItem.transform.rotation = textItem.transform.rotation;
showItem.transform.localScale = textItem.transform.localScale;
offsetNextItem += 0.1f;
}
}
示例3: Start
//Use this for initialization
void Start()
{
text = new GameObject("SomeGUIText");
Instantiate(text);
myText = text.AddComponent<GUIText>();
myText.transform.position = new Vector3(0.1f,0.9f,0f);
myText.GetComponent<GUIText> ().text = "Score ";
myText.GetComponent<GUIText> ().fontSize = 100;
SetCountText ();
anim = GetComponent<Animator>();
highScore = PlayerPrefs.GetInt("HighScore");
skin = Resources.Load("GUISkin") as GUISkin;
}
示例4: createDialogObjects
/// <summary>
/// Creates the dialog objects.
/// </summary>
public void createDialogObjects() {
dialogSpeakerText = Instantiate(dialogSpeakerText) as GUIText;
dialogSpeakerText.transform.position = speakerTextPos;
dialogText = Instantiate(dialogText) as GUIText;
dialogText.transform.position = dialogTextPos;
dialogTextWrapper = dialogText.GetComponent<WordWrapText>();
textBox = Instantiate(textBox) as Transform;
textBox.transform.parent = GameObject.Find("Main Camera").transform;
textBox.transform.localPosition = textBoxPos;
dialogNextText = Instantiate(dialogNextText) as GUIText;
dialogNextText.transform.position = dialogNextTextPos;
}