本文整理汇总了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();
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}