void Start() { button = GetComponentInChildren <Button>(); button.onClick.AddListener(() => OnClick()); GameObject obj = GameObject.FindGameObjectWithTag("ForegroundUI"); foreground = obj.GetComponentInChildren <Animator>(); contFore = obj.GetComponentInChildren <ControllerForeground>(); }
private void OnEnable() { GameObject obj = GameObject.FindGameObjectWithTag("ForegroundUI"); foreground = obj.GetComponentInChildren <Animator>(); contFore = obj.GetComponentInChildren <ControllerForeground>(); contFore.FadeInEvent += EndApplication; foreground.SetTrigger("FadeOut"); }
private void OnEnable() { GameObject obj = GameObject.FindGameObjectWithTag("ForegroundUI"); foreground = obj.GetComponentInChildren <Animator>(); contFore = obj.GetComponentInChildren <ControllerForeground>(); contFore.FadeInEvent += BackToMenu; foreground.SetTrigger("FadeOut"); obj = GameObject.FindGameObjectWithTag("TransitionData"); transData = obj.GetComponentInChildren <DataTransition>(); }
private void Start() { button = GetComponentInChildren <Button>(); button.onClick.AddListener(() => OnButtonPress()); GameObject obj = GameObject.FindGameObjectWithTag("ForegroundUI"); foreground = obj.GetComponentInChildren <Animator>(); contFore = obj.GetComponentInChildren <ControllerForeground>(); obj = GameObject.FindGameObjectWithTag("TransitionData"); dataTransition = obj.GetComponentInChildren <DataTransition>(); }
private void AssignValues() { transitionData = GameObject.FindGameObjectWithTag("TransitionData") .GetComponentInChildren<DataTransition>(); globalMusic = GameObject.FindGameObjectWithTag("GlobalMusic"); momentDisplayCont = GameObject.FindGameObjectWithTag("MomentDisplayController"); GameObject obj = GameObject.FindGameObjectWithTag("ForegroundUI"); if(obj != null) { foreground = obj.GetComponentInChildren<Animator>(); contFore = obj.GetComponentInChildren<ControllerForeground>(); } }