Ejemplo n.º 1
0
        // Token: 0x06004858 RID: 18520 RVA: 0x00183EFC File Offset: 0x001822FC
        public static IEnumerator AnimationRotate(Notify notify)
        {
            RectTransform rect           = notify.GetComponent <RectTransform>();
            Vector3       start_rotarion = rect.rotation.eulerAngles;
            float         time           = 0.5f;
            float         end_time       = Time.time + time;

            while (Time.time <= end_time)
            {
                float rotation_x = Mathf.Lerp(0f, 90f, 1f - (end_time - Time.time) / time);
                rect.rotation = Quaternion.Euler(rotation_x, start_rotarion.y, start_rotarion.z);
                yield return(null);
            }
            rect.rotation = Quaternion.Euler(start_rotarion);
            yield break;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Rotate animation.
        /// </summary>
        /// <param name="notify">Notify.</param>
        static public IEnumerator AnimationRotate(Notify notify)
        {
            var rect           = notify.GetComponent <RectTransform>();
            var start_rotarion = rect.rotation.eulerAngles;
            var time           = 0.5f;

            var end_time = Time.time + time;

            while (Time.time <= end_time)
            {
                var rotation_x = Mathf.Lerp(0, 90, 1 - (end_time - Time.time) / time);

                rect.rotation = Quaternion.Euler(rotation_x, start_rotarion.y, start_rotarion.z);
                yield return(null);
            }

            //return rotation back for future use
            rect.rotation = Quaternion.Euler(start_rotarion);
        }
Ejemplo n.º 3
0
        // Token: 0x06004859 RID: 18521 RVA: 0x00183F18 File Offset: 0x00182318
        public static IEnumerator AnimationCollapse(Notify notify)
        {
            RectTransform rect = notify.GetComponent <RectTransform>();

            EasyLayout.EasyLayout layout = notify.GetComponentInParent <EasyLayout.EasyLayout>();
            float max_height             = rect.rect.height;
            float speed    = 200f;
            float time     = max_height / speed;
            float end_time = Time.time + time;

            while (Time.time <= end_time)
            {
                float height = Mathf.Lerp(max_height, 0f, 1f - (end_time - Time.time) / time);
                rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height);
                if (layout != null)
                {
                    layout.UpdateLayout();
                }
                yield return(null);
            }
            rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, max_height);
            yield break;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Collapse animation.
        /// </summary>
        /// <param name="notify">Notify.</param>
        static public IEnumerator AnimationCollapse(Notify notify)
        {
            var rect       = notify.GetComponent <RectTransform>();
            var layout     = notify.GetComponentInParent <EasyLayout.EasyLayout>();
            var max_height = rect.rect.height;
            var speed      = 200f;       //pixels per second

            var time     = max_height / speed;
            var end_time = Time.time + time;

            while (Time.time <= end_time)
            {
                var height = Mathf.Lerp(max_height, 0, 1 - (end_time - Time.time) / time);
                rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height);
                if (layout != null)
                {
                    layout.UpdateLayout();
                }
                yield return(null);
            }

            //return height back for future use
            rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, max_height);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Rotate animation.
        /// </summary>
        /// <param name="notify">Notify.</param>
        public static IEnumerator AnimationRotate(Notify notify)
        {
            var rect = notify.GetComponent<RectTransform>();
            var start_rotarion = rect.rotation.eulerAngles;
            var time = 0.5f;

            var end_time = Time.time + time;

            while (Time.time <= end_time)
            {
                var rotation_x = Mathf.Lerp(0, 90, 1 - (end_time - Time.time) / time);

                rect.rotation = Quaternion.Euler(rotation_x, start_rotarion.y, start_rotarion.z);
                yield return null;
            }

            //return rotation back for future use
            rect.rotation = Quaternion.Euler(start_rotarion);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Collapse animation.
        /// </summary>
        /// <param name="notify">Notify.</param>
        public static IEnumerator AnimationCollapse(Notify notify)
        {
            var rect = notify.GetComponent<RectTransform>();
            var layout = notify.GetComponentInParent<EasyLayout.EasyLayout>();
            var max_height = rect.rect.height;
            var speed = 200f;//pixels per second

            var time = max_height / speed;
            var end_time = Time.time + time;

            while (Time.time <= end_time)
            {
                var height = Mathf.Lerp(max_height, 0, 1 - (end_time - Time.time) / time);
                rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height);
                if (layout!=null)
                {
                    layout.UpdateLayout();
                }
                yield return null;
            }

            //return height back for future use
            rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, max_height);
        }