void Awake() { UISlideElement slideElement = GetComponentInParent <UISlideElement>(); if (slideElement == null) { Debug.LogWarning(name + " SlideActivated couldn't find a UISlideElement"); gameObject.SetActive(false); return; } slideElement.onStartSlideIn += OnSlideIn; // (() => gameObject.SetActive(true)); slideElement.onIsOut += OnSlideOut; // (() => gameObject.SetActive(false)); toFade = GetComponent <UnityEngine.UI.Image>(); gameObject.SetActive(false); }