void Start() { choiceTxt = GetComponentsInChildren <Text>(); for (int i = 0; i < 3; i++) { choiceTxt[i].text = choiceStrings[i]; } choiceButtons = new List <Button>(); foreach (var item in choiceTxt) { choiceButtons.Add(item.GetComponentInParent <Button>()); choiceButtons[choiceButtons.Count - 1].onClick.AddListener(delegate() { HandleChoice(item.text); }); } // i.e. it equals nothing if (choiceStrings[2].Equals("")) { Destroy(choiceButtons[2].gameObject); choiceButtons.RemoveAt(2); } scriptMastRef = Camera.main.GetComponent <SceneManager>().ScriptMaster; foreach (Image img in this.gameObject.GetComponentsInChildren <Image>()) { img.color = new Color(1, 1, 1, 0); } StartCoroutine(FadeIn()); }
// Use this for initialization void Start() { debugTxt = GetComponentInChildren <Text>(); M22SM = Camera.main.GetComponent <M22.SceneManager>().ScriptMaster; }
public override void Start() { ScriptMaster = Camera.main.GetComponent <M22.ScriptMaster>(); }