當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。