void Start() { //Assign the child "Text" game object that is a child to this game object. transformChildText = gameObject.transform.Find("Text"); //Assign its Text component to childText variable. childText = transformChildText.gameObject.GetComponent <Text>(); //Get PanelButtonExhibition game object. panelButtonExhibition = GameObject.Find("PanelButtonExhibition"); //Get reference to its script. scriptPanelButtonExhibition = panelButtonExhibition.GetComponent <ScriptPanelButtonExhibition>(); }
void Start() { //Assign the child "Text" game object that is a child to this game object. transformChildText = gameObject.transform.Find("Text"); //Assign its Text component to childText variable. childText = transformChildText.gameObject.GetComponent<Text>(); //Get PanelButtonExhibition game object. panelButtonExhibition = GameObject.Find("PanelButtonExhibition"); //Get reference to its script. scriptPanelButtonExhibition = panelButtonExhibition.GetComponent<ScriptPanelButtonExhibition>(); }