void ShowFrame(System.Action callback) { if (m_Frame != null) { m_Frame.SendMessageToAll("OnActivityBeginShow"); } System.Action showAction = () => { callback.InvokeIfNotNull(); if (m_Frame != null) { m_Frame.SendMessageToAll("OnActivityEndShow"); } }; if (m_Frame) { m_Frame.gameObject.SetActive(true); } var tweener = frame != null?frame.GetComponent <AbstractTweenBehaviour>() : null; if (tweener != null) { LayoutRebuilder.ForceRebuildLayoutImmediate(this.transform as RectTransform); tweener.Tween("show", (tag) => { showAction.InvokeIfNotNull(); }); } else { showAction.InvokeIfNotNull(); } }
void ShowFrame(System.Action callback) { if (m_Frame != null) { m_Frame.SendMessageToAll("OnActivityBeginShow"); } System.Action showAction = () => { if (m_Frame != null) { m_Frame.transform.localPosition = GetValidLocalPositionInsideActivity(m_Frame); } callback.InvokeIfNotNull(); if (m_Frame != null) { m_Frame.SendMessageToAll("OnActivityEndShow"); } }; if (m_Frame) { m_Frame.gameObject.SetActive(true); } var tweener = frame != null?frame.GetAddComponent <EasyFrameAnimator>() : null; if (tweener != null) { tweener.Clear(); tweener.transitionDuration = 0.2f; tweener.scaleIn = true; tweener.scaleInScale = 0; tweener.fadeIn = true; tweener.fadeInAlpha = 0; LayoutRebuilder.ForceRebuildLayoutImmediate(this.transform as RectTransform); tweener.Tween("show", (tag) => { showAction.InvokeIfNotNull(); }); if (m_Frame != null) { m_Frame.transform.localPosition = GetValidLocalPositionInsideActivity(m_Frame); } } else { showAction.InvokeIfNotNull(); } }