public void TransitionIn() { if (m_TransitionIn == ETransitionType.Fade || m_TransitionOut == ETransitionType.Fade) { CDUIPanelFader pf = gameObject.GetComponent <CDUIPanelFader>(); pf.FadeIn(m_TransitionInTime); } }
public void Awake() { if (m_TransitionIn == ETransitionType.Fade || m_TransitionOut == ETransitionType.Fade) { CDUIPanelFader pf = gameObject.AddComponent <CDUIPanelFader>(); pf.EventFadeInFinished += OnTransitionInFinish; pf.EventFadeOutFinished += OnTransitionOutFinish; } // Disable self, Root2D will handle us gameObject.SetActive(false); }