Example #1
0
        public void Setup(RippleData data, Vector2 positon, IRippleCreator creator, bool oscillate = false)
        {
            m_RippleData = data;
            m_RippleParent = (RectTransform)data.RippleParent;
            rectTransform.SetParent(m_RippleParent);
            rectTransform.SetSiblingIndex(0);
            m_Oscillate = oscillate;
            rectTransform.sizeDelta = Vector2.zero;

            switch (GetComponentInParent<Canvas>().renderMode)
            {
                case RenderMode.ScreenSpaceOverlay:
                    rectTransform.position = new Vector3(positon.x, positon.y, m_RippleParent.position.z);
                    break;
                case RenderMode.ScreenSpaceCamera:
                    rectTransform.position = new Ray(Camera.main.transform.position, Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, m_RippleParent.position.z))).GetPoint(Vector3.Distance(Camera.main.transform.position, m_RippleParent.position));
                    break;
                case RenderMode.WorldSpace:
                    rectTransform.position = new Ray(Camera.main.transform.position, Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, m_RippleParent.position.z))).GetPoint(Vector3.Distance(Camera.main.transform.position, m_RippleParent.position));
                    break;
            }

            rectTransform.localEulerAngles = Vector3.zero;
            image.color = data.Color;
            canvasGroup.alpha = data.StartAlpha;
            m_AnimationDuration = 4f / data.Speed;
            m_RippleCreator = creator;
            if (data.PlaceRippleBehind)
            {
                int index = m_RippleParent.GetSiblingIndex();
                rectTransform.SetParent(m_RippleParent.parent);
                rectTransform.SetSiblingIndex(index);
            }

        }
        /// <summary>
        /// Copies this RippleData.
        /// </summary>
        /// <returns>A copy of this RippleData.</returns>
        public RippleData Copy()
        {
            RippleData data = new RippleData();

            data.AutoSize          = AutoSize;
            data.SizePercent       = SizePercent;
            data.ManualSize        = ManualSize;
            data.SizeMode          = SizeMode;
            data.Speed             = Speed;
            data.Color             = Color;
            data.StartAlpha        = StartAlpha;
            data.EndAlpha          = EndAlpha;
            data.MoveTowardCenter  = MoveTowardCenter;
            data.RippleParent      = RippleParent;
            data.PlaceRippleBehind = PlaceRippleBehind;
            return(data);
        }
Example #3
0
        /// <summary>
        /// Sets the ripple's transform and rippleData, and prepares it to start expanding.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="position">The position.</param>
        /// <param name="creator">The creator to send callbacks to.</param>
        /// <param name="oscillate">If true, the ripple will oscillate when expanded.</param>
        public void Setup(RippleData data, Vector2 position, IRippleCreator creator, bool oscillate = false)
        {
            m_RippleData   = data;
            m_RippleParent = (RectTransform)data.RippleParent;
            rectTransform.SetParent(m_RippleParent);
            rectTransform.SetSiblingIndex(0);
            m_Oscillate             = oscillate;
            rectTransform.sizeDelta = Vector2.zero;

            Camera camera = FindObjectOfType <Camera>();

            switch (GetComponentInParent <Canvas>().renderMode)
            {
            case RenderMode.ScreenSpaceOverlay:
                rectTransform.position = new Vector3(position.x, position.y, m_RippleParent.position.z);
                break;

            case RenderMode.ScreenSpaceCamera:
                rectTransform.position = camera.ScreenToWorldPoint(new Vector3(position.x, position.y, m_RippleParent.position.z));
                break;

            case RenderMode.WorldSpace:
                rectTransform.position = camera.ScreenToWorldPoint(new Vector3(position.x, position.y, m_RippleParent.position.z));
                break;
            }

            m_Material = rippleData.Shadow ? m_ShadowedRippleMaterial : m_RippleMaterial;

            rectTransform.localEulerAngles = Vector3.zero;
            color               = data.Color;
            canvasGroup.alpha   = data.StartAlpha;
            m_AnimationDuration = 4f / data.Speed;
            m_RippleCreator     = creator;

            if (data.PlaceRippleBehind)
            {
                int index = m_RippleParent.GetSiblingIndex();
                rectTransform.SetParent(m_RippleParent.parent);
                rectTransform.SetSiblingIndex(index);
            }
        }
Example #4
0
        /// <summary>
        /// Sets the ripple's transform and rippleData, and prepares it to start expanding.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="positon">The positon.</param>
        /// <param name="creator">The creator to send callbacks to.</param>
        /// <param name="oscillate">If true, the ripple will oscillate when expanded.</param>
        public void Setup(RippleData data, Vector2 positon, IRippleCreator creator, bool oscillate = false)
        {
            m_RippleData   = data;
            m_RippleParent = (RectTransform)data.RippleParent;
            rectTransform.SetParent(m_RippleParent);
            rectTransform.SetSiblingIndex(0);
            m_Oscillate             = oscillate;
            rectTransform.sizeDelta = Vector2.zero;
            rectTransform.position  = new Vector3(positon.x, positon.y, m_RippleParent.position.z);

            rectTransform.localEulerAngles = Vector3.zero;
            color               = data.Color;
            canvasGroup.alpha   = data.StartAlpha;
            m_AnimationDuration = 4f / data.Speed;
            m_RippleCreator     = creator;

            if (data.PlaceRippleBehind)
            {
                int index = m_RippleParent.GetSiblingIndex();
                rectTransform.SetParent(m_RippleParent.parent);
                rectTransform.SetSiblingIndex(index);
            }
        }
Example #5
0
        public void Setup(RippleData data, Vector2 positon, IRippleCreator creator, bool oscillate = false)
        {
            m_RippleData   = data;
            m_RippleParent = (RectTransform)data.RippleParent;
            rectTransform.SetParent(m_RippleParent);
            rectTransform.SetSiblingIndex(0);
            m_Oscillate             = oscillate;
            rectTransform.sizeDelta = Vector2.zero;

            switch (GetComponentInParent <Canvas>().renderMode)
            {
            case RenderMode.ScreenSpaceOverlay:
                rectTransform.position = new Vector3(positon.x, positon.y, m_RippleParent.position.z);
                break;

            case RenderMode.ScreenSpaceCamera:
                rectTransform.position = new Ray(Camera.main.transform.position, Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, m_RippleParent.position.z))).GetPoint(Vector3.Distance(Camera.main.transform.position, m_RippleParent.position));
                break;

            case RenderMode.WorldSpace:
                rectTransform.position = new Ray(Camera.main.transform.position, Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, m_RippleParent.position.z))).GetPoint(Vector3.Distance(Camera.main.transform.position, m_RippleParent.position));
                break;
            }

            rectTransform.localEulerAngles = Vector3.zero;
            image.color         = data.Color;
            canvasGroup.alpha   = data.StartAlpha;
            m_AnimationDuration = 4f / data.Speed;
            m_RippleCreator     = creator;
            if (data.PlaceRippleBehind)
            {
                int index = m_RippleParent.GetSiblingIndex();
                rectTransform.SetParent(m_RippleParent.parent);
                rectTransform.SetSiblingIndex(index);
            }
        }
 /// <summary>
 /// Clears the rippleData, call when resetting the ripple.
 /// </summary>
 public void ClearData()
 {
     m_RippleData = null;
 }
Example #7
0
 public void ClearData()
 {
     m_RippleData = null;
 }
Example #8
0
 public RippleData Copy()
 {
     RippleData data = new RippleData();
     data.AutoSize = AutoSize;
     data.SizePercent = SizePercent;
     data.ManualSize = ManualSize;
     data.SizeMode = SizeMode;
     data.Speed = Speed;
     data.Color = Color;
     data.StartAlpha = StartAlpha;
     data.EndAlpha = EndAlpha;
     data.MoveTowardCenter = MoveTowardCenter;
     data.RippleParent = RippleParent;
     data.PlaceRippleBehind = PlaceRippleBehind;
     return data;
 }
Example #9
0
        public void Hide()
        {
            m_Shadow = m_PanelShadowCanvasGroup != null;

            if (m_FinalExpandMode != ExpandMode.Rectangular)
            {
                m_MaskRect = rippleMask;

                m_MaskRect.SetParentAndScale(m_PanelRootRectTransform.parent, Vector3.one);

                RippleData rippleData = new RippleData
                {
                    RippleParent = m_MaskRect,
                    Shadow       = m_RippleHasShadow
                };

                m_Ripple = RippleManager.instance.GetRipple();
                m_Ripple.Setup(rippleData, m_MaskRect.position, null);
                m_Ripple.rectTransform.localScale = Vector3.one;
                m_Ripple.rectTransform.sizeDelta  = m_BaseRectTransform.sizeDelta;
                m_Ripple.color             = Color.white;
                m_Ripple.canvasGroup.alpha = 1f;
                m_Ripple.SubmitSizeForSoftening();

                m_CircleExpandedSize = Mathf.Sqrt(Mathf.Pow(Tween.QuintOut(0f, m_ExpandedSize.x, 1f, 0.5f), 2) + Mathf.Pow(Tween.QuintOut(0f, m_ExpandedSize.y, 1f, 0.5f), 2));
            }

            if (m_FinalExpandMode != ExpandMode.Radial)
            {
                m_WidthDuration  = 1f;
                m_HeightDuration = 1f;

                if (m_ExpandedSize.x > m_ExpandedSize.y)
                {
                    m_HeightDuration = (2 * (m_ExpandedSize.y / m_ExpandedSize.x) + 1f) / 3f;
                }
                else if (m_ExpandedSize.x < m_ExpandedSize.y)
                {
                    m_WidthDuration = (2 * (m_ExpandedSize.x / m_ExpandedSize.y) + 1f) / 3f;
                }
            }

            if (m_FinalExpandMode == ExpandMode.Radial)
            {
                m_PanelRootRectTransform.SetPositionRegardlessOfPivot(expandedPosition);
                m_PanelRootRectTransform.sizeDelta = expandedSize;

                TweenManager.TweenFloat(f =>
                {
                    m_MaskRect.sizeDelta = m_PanelRootRectTransform.sizeDelta;
                    m_MaskRect.position  = m_PanelRootRectTransform.GetPositionRegardlessOfPivot();

                    m_Ripple.rectTransform.sizeDelta = Tween.QuintSoftOut(new Vector2(m_CircleExpandedSize, m_CircleExpandedSize), m_BaseRectTransform.sizeDelta, f, 1f);
                    m_Ripple.rectTransform.position  = Tween.QuintSoftOut(m_PanelRootRectTransform.GetPositionRegardlessOfPivot(), m_BaseRectTransform.GetPositionRegardlessOfPivot(), f, 1f);
                    m_Ripple.SubmitSizeForSoftening();

                    if (m_Shadow)
                    {
                        m_PanelShadowCanvasGroup.alpha = Tween.QuintOut(1f, 0f, f, 0.5f);
                    }

                    m_PanelContentCanvasGroup.alpha = Tween.QuintOut(1f, 0f, f, 0.5f);
                    m_Ripple.color = m_Ripple.color.WithAlpha(Tween.QuintSoftOut(1f, 0f, f - 0.8f, 0.2f));
                },
                                        0f, 1f, m_AnimationDuration, tweenType: Tween.TweenType.Linear);

                TweenManager.TimedCallback(m_AnimationDuration, m_Ripple.InstantContract);
                TweenManager.TimedCallback(m_AnimationDuration * 0.5f, () => m_BaseRectTransform.gameObject.SetActive(true));
            }
            else if (m_FinalExpandMode == ExpandMode.Rectangular)
            {
                TweenManager.TweenFloat(f =>
                {
                    if (m_ExpandedPosition.y > m_BaseRectTransform.position.y)
                    {
                        m_PanelRootRectTransform.sizeDelta = new Vector2(
                            Tween.QuintInOut(expandedSize.x, m_BaseRectTransform.sizeDelta.x, f, m_WidthDuration),
                            Tween.QuintSoftOut(expandedSize.y, m_BaseRectTransform.sizeDelta.y, f, m_HeightDuration));

                        m_PanelRootRectTransform.SetPositionRegardlessOfPivot(new Vector2(
                                                                                  Tween.QuintInOut(expandedPosition.x, m_BaseRectTransform.GetPositionRegardlessOfPivot().x, f, m_WidthDuration),
                                                                                  Tween.QuintSoftOut(expandedPosition.y, m_BaseRectTransform.GetPositionRegardlessOfPivot().y, f, m_HeightDuration)));
                    }
                    else
                    {
                        m_PanelRootRectTransform.sizeDelta = new Vector2(
                            Tween.QuintSoftOut(expandedSize.x, m_BaseRectTransform.sizeDelta.x, f, m_WidthDuration),
                            Tween.QuintInOut(expandedSize.y, m_BaseRectTransform.sizeDelta.y, f, m_HeightDuration));

                        m_PanelRootRectTransform.SetPositionRegardlessOfPivot(new Vector2(
                                                                                  Tween.QuintSoftOut(expandedPosition.x, m_BaseRectTransform.GetPositionRegardlessOfPivot().x, f, m_WidthDuration),
                                                                                  Tween.QuintInOut(expandedPosition.y, m_BaseRectTransform.GetPositionRegardlessOfPivot().y, f, m_HeightDuration)));
                    }

                    if (m_Shadow)
                    {
                        m_PanelShadowCanvasGroup.alpha = Tween.QuintOut(1f, 0f, f - 0.75f, 0.25f);
                    }

                    m_PanelContentCanvasGroup.alpha = Tween.QuintSoftOut(1f, 0f, f, 0.25f);
                },
                                        0f, 1f, m_AnimationDuration, tweenType: Tween.TweenType.Linear);

                TweenManager.TimedCallback(m_AnimationDuration * 0.7f, () => m_BaseRectTransform.gameObject.SetActive(true));
            }
            else if (m_FinalExpandMode == ExpandMode.Hybrid)
            {
                Vector2 endPos = m_BaseRectTransform.GetPositionRegardlessOfPivot();

                TweenManager.TweenFloat(f =>
                {
                    if (m_ExpandedPosition.y > m_BaseRectTransform.position.y)
                    {
                        m_PanelRootRectTransform.sizeDelta = new Vector2(
                            Tween.QuintInOut(expandedSize.x, m_BaseRectTransform.sizeDelta.x, f, m_WidthDuration),
                            Tween.QuintSoftOut(expandedSize.y, m_BaseRectTransform.sizeDelta.y, f, m_HeightDuration));

                        m_PanelRootRectTransform.SetPositionRegardlessOfPivot(new Vector2(
                                                                                  Tween.QuintInOut(expandedPosition.x, endPos.x, f, m_WidthDuration),
                                                                                  Tween.QuintSoftOut(expandedPosition.y, endPos.y, f, m_HeightDuration)));
                    }
                    else
                    {
                        m_PanelRootRectTransform.sizeDelta = new Vector2(
                            Tween.QuintSoftOut(expandedSize.x, m_BaseRectTransform.sizeDelta.x, f, m_WidthDuration),
                            Tween.QuintInOut(expandedSize.y, m_BaseRectTransform.sizeDelta.y, f, m_HeightDuration));

                        m_PanelRootRectTransform.SetPositionRegardlessOfPivot(new Vector2(
                                                                                  Tween.QuintSoftOut(expandedPosition.x, endPos.x, f, m_WidthDuration),
                                                                                  Tween.QuintInOut(expandedPosition.y, endPos.y, f, m_HeightDuration)));
                    }

                    m_MaskRect.sizeDelta = m_PanelRootRectTransform.sizeDelta;
                    m_MaskRect.position  = m_PanelRootRectTransform.GetPositionRegardlessOfPivot();

                    m_Ripple.rectTransform.sizeDelta        = Tween.QuintSoftOut(new Vector2(m_CircleExpandedSize, m_CircleExpandedSize), m_BaseRectTransform.sizeDelta, f, Mathf.Min(m_WidthDuration, m_HeightDuration));
                    m_Ripple.rectTransform.anchoredPosition = Vector2.zero;
                    m_Ripple.SubmitSizeForSoftening();

                    if (m_Shadow)
                    {
                        m_PanelShadowCanvasGroup.alpha = Tween.QuintOut(1f, 0f, f, 0.15f);
                    }

                    m_PanelContentCanvasGroup.alpha = Tween.QuintOut(1f, 0f, f, 0.15f);
                    m_Ripple.color = m_Ripple.color.WithAlpha(Tween.QuintSoftOut(1f, 0f, f - 0.8f, 0.2f));
                },
                                        0f, 1f, m_AnimationDuration, tweenType: Tween.TweenType.Linear);

                TweenManager.TimedCallback(m_AnimationDuration, m_Ripple.InstantContract);
                TweenManager.TimedCallback(m_AnimationDuration * 0.8f, () => m_BaseRectTransform.gameObject.SetActive(true));
            }

            if (m_DarkenBackground)
            {
                TweenManager.TweenColor(color => m_BackgroundImage.color = color, m_BackgroundImage.color, Color.clear, m_AnimationDuration * 0.5f, m_AnimationDuration * 0.5f, () => m_ClickableBackground.gameObject.SetActive(false), tweenType: Tween.TweenType.EaseInOutCubed);
            }

            TweenManager.TimedCallback(m_AnimationDuration, () => m_PanelRootRectTransform.gameObject.SetActive(false));
        }
Example #10
0
        public void Show()
        {
            m_PanelRootRectTransform.gameObject.SetActive(true);

            if (!m_HasExpandedInfo)
            {
                if (m_AutoExpandedPosition)
                {
                    m_ExpandedPosition = m_PanelRootRectTransform.GetPositionRegardlessOfPivot();
                }

                if (m_AutoExpandedSize)
                {
                    m_ExpandedSize = m_PanelRootRectTransform.sizeDelta;
                }

                CalculateExpandMode();

                m_HasExpandedInfo = true;
            }

            if (m_DarkenBackground || m_ClickBackgroundToClose)
            {
                if (m_ClickableBackground == null)
                {
                    m_ClickableBackground = PrefabManager.InstantiateGameObject(PrefabManager.ResourcePrefabs.clickableBackground, m_PanelRootRectTransform.parent).GetAddComponent <RectTransform>();
                    m_ClickableBackground.SetSiblingIndex(m_PanelRootRectTransform.GetSiblingIndex());
                    m_BackgroundImage   = m_ClickableBackground.gameObject.GetComponent <Image>();
                    m_BackgroundTrigger = m_ClickableBackground.gameObject.GetComponent <EventTrigger>();
                    EventTrigger.Entry entry = new EventTrigger.Entry();
                    entry.callback.AddListener(baseEventData => OnBackgroundClick());
                    m_BackgroundTrigger.triggers.Add(entry);
                }

                m_ClickableBackground.sizeDelta        = new Vector2(10000, 10000);
                m_ClickableBackground.anchoredPosition = m_ExpandedPosition;
                m_BackgroundImage.color = Color.clear;
                m_ClickableBackground.gameObject.SetActive(true);
            }

            m_PanelContentCanvasGroup.alpha = 0f;

            if (m_RippleHasShadow && m_PanelShadowCanvasGroup != null)
            {
                m_PanelShadowCanvasGroup.alpha = 0f;
            }

            if (m_FinalExpandMode != ExpandMode.Rectangular)
            {
                m_MaskRect = rippleMask;

                m_MaskRect.SetParentAndScale(m_PanelRootRectTransform.parent, Vector3.one);

                RippleData rippleData = new RippleData
                {
                    RippleParent = m_MaskRect,
                    Shadow       = m_RippleHasShadow
                };

                m_Ripple = RippleManager.instance.GetRipple();
                m_Ripple.Setup(rippleData, m_MaskRect.position, null);
                m_Ripple.rectTransform.localScale = Vector3.one;
                m_Ripple.rectTransform.sizeDelta  = m_BaseRectTransform.sizeDelta;
                m_Ripple.color             = Color.white;
                m_Ripple.canvasGroup.alpha = 1f;
                m_Ripple.SubmitSizeForSoftening();

                m_CircleExpandedSize = Mathf.Sqrt(Mathf.Pow(Tween.QuintOut(0f, m_ExpandedSize.x, 1f, 0.5f), 2) +
                                                  Mathf.Pow(Tween.QuintOut(0f, m_ExpandedSize.y, 1f, 0.5f), 2));
            }

            if (m_FinalExpandMode != ExpandMode.Radial)
            {
                m_WidthDuration  = 1f;
                m_HeightDuration = 1f;

                if (m_ExpandedSize.x > m_ExpandedSize.y)
                {
                    m_HeightDuration = (2 * (m_ExpandedSize.y / m_ExpandedSize.x) + 1f) / 3f;
                }
                else if (m_ExpandedSize.x < m_ExpandedSize.y)
                {
                    m_WidthDuration = (2 * (m_ExpandedSize.x / m_ExpandedSize.y) + 1f) / 3f;
                }
            }

            m_BaseRectTransform.gameObject.SetActive(false);

            m_Shadow = m_PanelShadowCanvasGroup != null;

            if (m_FinalExpandMode == ExpandMode.Radial)
            {
                m_PanelRootRectTransform.SetPositionRegardlessOfPivot(expandedPosition);
                m_PanelRootRectTransform.sizeDelta = expandedSize;

                TweenManager.TweenFloat(f =>
                {
                    m_MaskRect.sizeDelta = m_PanelRootRectTransform.sizeDelta;
                    m_MaskRect.position  = m_PanelRootRectTransform.GetPositionRegardlessOfPivot();

                    m_Ripple.rectTransform.sizeDelta = Tween.CubeSoftOut(m_Ripple.rectTransform.sizeDelta, new Vector2(m_CircleExpandedSize, m_CircleExpandedSize), f, 1f);
                    m_Ripple.rectTransform.position  = Tween.CubeSoftOut(m_BaseRectTransform.GetPositionRegardlessOfPivot(), m_PanelRootRectTransform.GetPositionRegardlessOfPivot(), f, 1f);
                    m_Ripple.SubmitSizeForSoftening();

                    if (m_Shadow)
                    {
                        m_PanelShadowCanvasGroup.alpha = Tween.CubeInOut(0f, 1f, f - 0.5f, 0.5f);
                    }

                    m_PanelContentCanvasGroup.alpha = Tween.CubeInOut(0f, 1f, f - 0.5f, 0.25f);
                    m_Ripple.color = m_Ripple.color.WithAlpha(Tween.CubeInOut(1f, 0f, f - 0.5f, 0.5f));
                },
                                        0f, 1f, m_AnimationDuration, tweenType: Tween.TweenType.Linear);

                TweenManager.TimedCallback(m_AnimationDuration, m_Ripple.InstantContract);
            }
            else if (m_FinalExpandMode == ExpandMode.Rectangular)
            {
                TweenManager.TweenFloat(f =>
                {
                    if (m_ExpandedPosition.y > m_BaseRectTransform.position.y)
                    {
                        m_PanelRootRectTransform.sizeDelta = new Vector2(
                            Tween.QuintOut(m_BaseRectTransform.sizeDelta.x, expandedSize.x, f, m_WidthDuration),
                            Tween.QuintSoftOut(m_BaseRectTransform.sizeDelta.y, expandedSize.y, f, m_HeightDuration));

                        m_PanelRootRectTransform.SetPositionRegardlessOfPivot(new Vector2(
                                                                                  Tween.QuintOut(m_BaseRectTransform.GetPositionRegardlessOfPivot().x, expandedPosition.x, f, m_WidthDuration),
                                                                                  Tween.QuintSoftOut(m_BaseRectTransform.GetPositionRegardlessOfPivot().y, expandedPosition.y, f, m_HeightDuration)));
                    }
                    else
                    {
                        m_PanelRootRectTransform.sizeDelta = new Vector2(
                            Tween.QuintSoftOut(m_BaseRectTransform.sizeDelta.x, expandedSize.x, f, m_WidthDuration),
                            Tween.QuintOut(m_BaseRectTransform.sizeDelta.y, expandedSize.y, f, m_HeightDuration));

                        m_PanelRootRectTransform.SetPositionRegardlessOfPivot(new Vector2(
                                                                                  Tween.QuintSoftOut(m_BaseRectTransform.GetPositionRegardlessOfPivot().x, expandedPosition.x, f, m_WidthDuration),
                                                                                  Tween.QuintOut(m_BaseRectTransform.GetPositionRegardlessOfPivot().y, expandedPosition.y, f, m_HeightDuration)));
                    }

                    if (m_Shadow)
                    {
                        m_PanelShadowCanvasGroup.alpha = Tween.QuintOut(0f, 1f, f, 0.25f);
                    }
                    m_PanelContentCanvasGroup.alpha = Tween.QuintInOut(0f, 1f, f - 0.5f, 0.5f);
                },
                                        0f, 1f, m_AnimationDuration, tweenType: Tween.TweenType.Linear);
            }
            else if (m_FinalExpandMode == ExpandMode.Hybrid)
            {
                Vector2 startPos = m_BaseRectTransform.GetPositionRegardlessOfPivot();

                m_PanelRootRectTransform.sizeDelta = m_BaseRectTransform.sizeDelta;
                m_PanelRootRectTransform.SetPositionRegardlessOfPivot(m_BaseRectTransform.GetPositionRegardlessOfPivot());

                TweenManager.TweenFloat(f =>
                {
                    if (m_ExpandedPosition.y > m_BaseRectTransform.position.y)
                    {
                        m_PanelRootRectTransform.sizeDelta = new Vector2(
                            Tween.QuintOut(m_BaseRectTransform.sizeDelta.x, expandedSize.x, f, m_WidthDuration),
                            Tween.QuintSoftOut(m_BaseRectTransform.sizeDelta.y, expandedSize.y, f, m_HeightDuration));

                        m_PanelRootRectTransform.SetPositionRegardlessOfPivot(new Vector2(
                                                                                  Tween.QuintOut(startPos.x, expandedPosition.x, f, m_WidthDuration),
                                                                                  Tween.QuintSoftOut(startPos.y, expandedPosition.y, f, m_HeightDuration)));
                    }
                    else
                    {
                        m_PanelRootRectTransform.sizeDelta = new Vector2(
                            Tween.QuintSoftOut(m_BaseRectTransform.sizeDelta.x, expandedSize.x, f, m_WidthDuration),
                            Tween.QuintOut(m_BaseRectTransform.sizeDelta.y, expandedSize.y, f, m_HeightDuration));

                        m_PanelRootRectTransform.SetPositionRegardlessOfPivot(new Vector2(
                                                                                  Tween.QuintSoftOut(startPos.x, expandedPosition.x, f, m_WidthDuration),
                                                                                  Tween.QuintOut(startPos.y, expandedPosition.y, f, m_HeightDuration)));
                    }

                    m_MaskRect.sizeDelta = m_PanelRootRectTransform.sizeDelta;
                    m_MaskRect.position  = m_PanelRootRectTransform.GetPositionRegardlessOfPivot();

                    m_Ripple.rectTransform.sizeDelta        = Tween.CubeSoftOut(m_Ripple.rectTransform.sizeDelta, new Vector2(m_CircleExpandedSize, m_CircleExpandedSize), f - 0.2f, 1f);
                    m_Ripple.rectTransform.anchoredPosition = Vector2.zero;
                    m_Ripple.SubmitSizeForSoftening();

                    if (m_Shadow)
                    {
                        m_PanelShadowCanvasGroup.alpha = Tween.CubeInOut(0f, 1f, f - 0.4f, 0.6f);
                    }

                    m_PanelContentCanvasGroup.alpha = Tween.CubeInOut(0f, 1f, f - 0.4f, 0.3f);
                    m_Ripple.color = m_Ripple.color.WithAlpha(Tween.CubeInOut(1f, 0f, f - 0.5f, 0.5f));
                },
                                        0f, 1f, m_AnimationDuration, tweenType: Tween.TweenType.Linear);

                if (m_DarkenBackground)
                {
                    TweenManager.TweenColor(color => m_BackgroundImage.color = color, m_BackgroundImage.color, MaterialColor.disabledDark, m_AnimationDuration * 0.5f, m_AnimationDuration * 0.5f, tweenType: Tween.TweenType.EaseInOutCubed);
                }

                TweenManager.TimedCallback(m_AnimationDuration * 0.7f, m_Ripple.InstantContract);
            }
        }