当前位置: 首页>>代码示例>>C#>>正文


C# GUIText.GetComponent方法代码示例

本文整理汇总了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;
 }
开发者ID:FreyPauline,项目名称:FFP_perso,代码行数:12,代码来源:gameOverScript.cs

示例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;
        }
    }
开发者ID:weimingtom,项目名称:rpg-game-2013,代码行数:15,代码来源:SellList.cs

示例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;
 }
开发者ID:FreyPauline,项目名称:FFP_perso,代码行数:14,代码来源:charactereScript.cs

示例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;

	}
开发者ID:metanymie,项目名称:jga,代码行数:21,代码来源:CutsceneController.cs


注:本文中的GUIText.GetComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。