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


C# Text.GetComponentInChildren方法代码示例

本文整理汇总了C#中Text.GetComponentInChildren方法的典型用法代码示例。如果您正苦于以下问题:C# Text.GetComponentInChildren方法的具体用法?C# Text.GetComponentInChildren怎么用?C# Text.GetComponentInChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Text的用法示例。


在下文中一共展示了Text.GetComponentInChildren方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

	// Use this for initialization
	void Start () {

		hoverImage = GameObject.Find("Image").GetComponent<Image>();

		answer1 = GameObject.Find("answer1_button").GetComponent<Button>();
		answer2 = GameObject.Find("answer2_button").GetComponent<Button>();
		answer3 = GameObject.Find("answer3_button").GetComponent<Button>();
		answer4 = GameObject.Find("answer4_button").GetComponent<Button>();

		questionText = GameObject.Find("question_text").GetComponent<Text>();

		// read settings from file
		string[] preferences = PreferencesManager.read();
		string sound = preferences[0];
		int font_size = int.Parse (preferences[1]);
		timeDelay = int.Parse (preferences[2]);

		// set font size
		answer1.GetComponentInChildren<Text> ().fontSize = font_size;
		answer2.GetComponentInChildren<Text> ().fontSize = font_size;
		answer3.GetComponentInChildren<Text> ().fontSize = font_size;
		answer4.GetComponentInChildren<Text> ().fontSize = font_size;
		questionText.GetComponentInChildren<Text> ().fontSize = font_size;

		questionSetManager = new QuestionSetManager ();
		questionSet = questionSetManager.importQuestions();

		questionIndex = -1;
		timeSinceLastCall = 0f;
		hoverEngaged = false;
		hoverImage.gameObject.SetActive(true);
		hoverImage.fillAmount = 0f;
		hoveredButton = null;
		buttonPressed = false;

		loadNewQuestion();
	}
开发者ID:bcr3ative,项目名称:EduQuiz,代码行数:38,代码来源:NewGameManager.cs

示例2: Start

 void Start()
 {
     locker = true;
     board = GameObject.FindGameObjectWithTag ("HoldBoard").GetComponent<Board> ();
     PlayerText = GameObject.FindGameObjectWithTag ("PlayerTextTag").GetComponent<Text> ();
     TimeText = GameObject.FindGameObjectWithTag ("TimeTextTag").GetComponent<Text> ();
     PlayerText.enabled = false;
     PlayerText.GetComponentInChildren<Image> ().enabled = false;
     TimeText.enabled = false;
     TimeText.GetComponentInChildren<Image> ().enabled = false;
     DisableAllHoodles ();
     WinText = GameObject.FindGameObjectWithTag ("WinTextTag").GetComponent<Text> ();
     WinPanel = GameObject.FindGameObjectWithTag ("WinPanelTag").GetComponent<Image> ();
     TwoPlayerButton = GameObject.FindGameObjectWithTag ("2PlayerButton").GetComponent<Button> ();
     ThreePlayerButton = GameObject.FindGameObjectWithTag ("3PlayerButton").GetComponent<Button> ();
     StartPanel = GameObject.FindGameObjectWithTag ("StartPanel").GetComponent<Image> ();
     PlayerText.text = playerList[0];
     timer = timeInterval * 60;
     TimeText.text = (timer/60+1).ToString ();
     board.setPlayer (6);
     currPlayer = 6;
 }
开发者ID:Harvey-Lu,项目名称:Chinese-Checkers,代码行数:22,代码来源:GameManager.cs

示例3: UnhideElements

 void UnhideElements(Button btn,Text txt,Button btn2,Text txt2,Button btn3,Text txt3)
 {
     btn.interactable = true;
     txt.GetComponentInChildren<CanvasRenderer>().SetAlpha(1);
     btn2.interactable = true;
     txt2.GetComponentInChildren<CanvasRenderer>().SetAlpha(1);
     btn3.interactable = true;
     txt3.GetComponentInChildren<CanvasRenderer>().SetAlpha(1);
 }
开发者ID:firasAltayeb,项目名称:Text101,代码行数:9,代码来源:TextController.cs

示例4: Start

    // Use this for initialization
    void Start()
    {
        BasePlayer pl = GameObject.Find ("Player").GetComponent<BasePlayer> ();
        itemsQuantity = pl.inventory.itemsQuantity;
        itemsData = ItemsData.itemsData;
        initEquipment ();

        presseText = GameObject.Find ("Interface").transform.Find ("PressE").GetComponent<Text> ();
        if (presseText == null) {
            Debug.LogError("presseText");
        }
        presseText.enabled = false;
        presseText.text = "<b>[E]</b> prohledat mrtvolu.";

        lootList = GameObject.Find ("Interface").transform.Find ("LootList").GetComponent<Text> ();
        if (lootList == null) {
            Debug.LogError("lootList");
        }
        lootList.enabled = false;
        lootList.text = "Tohle je konstruktorovej text";

        canvas = GameObject.Find ("Interface").GetComponent<Canvas> ();
        if (canvas == null) {
            Debug.LogError("canvas");
        }
        canvas.enabled = true;

        presseText.GetComponentInChildren<RectTransform>().gameObject.SetActive(false);
        lootList.GetComponentInChildren<RectTransform>().gameObject.SetActive(false);
    }
开发者ID:Morthalin,项目名称:TheGame,代码行数:31,代码来源:Loot.cs

示例5: HideTwoElements

 void HideTwoElements(Button btn,Text txt,Button btn2,Text txt2)
 {
     btn.interactable = false;
     txt.GetComponentInChildren<CanvasRenderer>().SetAlpha(0);
     btn2.interactable = false;
     txt2.GetComponentInChildren<CanvasRenderer>().SetAlpha(0);
 }
开发者ID:firasAltayeb,项目名称:Text101,代码行数:7,代码来源:TextController.cs


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