/// <summary>
		/// Clear notifications sequence.
		/// </summary>
		public void Clear()
		{
			if (currentNotify!=null)
			{
				currentNotify.Return();
				currentNotify = null;
			}
			notifySequence.ForEach(ReturnNotify);
			notifySequence.Clear();
		}
		/// <summary>
		/// Add the specified notification to sequence.
		/// </summary>
		/// <param name="notification">Notification.</param>
		/// <param name="type">Type.</param>
		public void Add(Notify notification, NotifySequence type)
		{
			if (type==NotifySequence.Last)
			{
				notifySequence.Add(notification);
			}
			else
			{
				notifySequence.Insert(0, notification);
			}
		}
		void Update()
		{
			if (currentNotify!=null)
			{
				return ;
			}
			if (notifySequence.Count==0)
			{
				return ;
			}
			currentNotify = notifySequence[0];
			notifySequence.RemoveAt(0);
			currentNotify.Display(NotifyDelay);
		}
Example #4
0
 /// <summary>
 /// Adds the template.
 /// </summary>
 /// <param name="template">Template name.</param>
 /// <param name="notifyTemplate">Notify template object.</param>
 /// <param name="replace">If set to <c>true</c> replace.</param>
 static public void AddTemplate(string template, Notify notifyTemplate, bool replace = true)
 {
     Templates.Add(template, notifyTemplate, replace);
 }
Example #5
0
 /// <summary>
 /// Slide animation to down.
 /// </summary>
 /// <param name="notify">Notify.</param>
 /// <returns>Animation.</returns>
 public static IEnumerator AnimationSlideDown(Notify notify)
 {
     return(AnimationSlideBase(notify, false, -1f, 200f));
 }
Example #6
0
 /// <summary>
 /// Adds the template.
 /// </summary>
 /// <param name="template">Template name.</param>
 /// <param name="notifyTemplate">Notify template object.</param>
 /// <param name="replace">If set to <c>true</c> replace.</param>
 public static void AddTemplate(string template, Notify notifyTemplate, bool replace = true)
 {
     Templates.Add(template, notifyTemplate, replace);
 }
		void NotifyDelay()
		{
			if (nextDelay!=null)
			{
				StopCoroutine(nextDelay);
			}

			if ((notifySequence.Count > 0) && (notifySequence[0].SequenceDelay > 0))
			{
				nextDelay = NextDelay();
				StartCoroutine(nextDelay);
			}
			else
			{
				currentNotify = null;
			}
		}
        IEnumerator NextDelay()
        {
            yield return(new WaitForSeconds(notifySequence[0].SequenceDelay));

            currentNotify = null;
        }
Example #9
0
 public static IEnumerator AnimationRotateUnscaledTime(Notify notify)
 {
     return(AnimationRotate(notify));
 }
Example #10
0
 /// <summary>
 /// Horizontal rotate animation.
 /// </summary>
 /// <param name="notify">Notify.</param>
 /// <returns>Returns animations.</returns>
 public static IEnumerator AnimationRotateHorizontal(Notify notify)
 {
     return(AnimationRotateBase(notify, true, 0.5f));
 }
Example #11
0
 /// <summary>
 /// Vertical rotate animation.
 /// </summary>
 /// <param name="notify">Notify.</param>
 /// <returns>Returns animations.</returns>
 public static IEnumerator AnimationRotateVertical(Notify notify)
 {
     return(AnimationRotateBase(notify, false, 0.5f));
 }
Example #12
0
 public static IEnumerator AnimationRotate(Notify notify)
 {
     return(AnimationRotateVertical(notify));
 }
Example #13
0
 static void AddCloseCallback(Notify notify)
 {
     if (notify.hideButton==null)
     {
         return ;
     }
     notify.hideButton.onClick.AddListener(notify.Hide);
 }
Example #14
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);
        }
Example #15
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);
        }
Example #16
0
 /// <summary>
 /// Handle disable event.
 /// </summary>
 protected virtual void OnDisable()
 {
     Notify.FreeSlide(rect);
 }
 void ReturnNotify(Notify notify)
 {
     notify.Return();
 }
Example #18
0
 public static IEnumerator AnimationCollapse(Notify notify)
 {
     return(AnimationCollapseVertical(notify));
 }
Example #19
0
 void OnDisable()
 {
     Notify.FreeSlide(rect);
 }
Example #20
0
 /// <summary>
 /// Vertical collapse animation.
 /// </summary>
 /// <param name="notify">Notify.</param>
 /// <returns>Returns animations.</returns>
 public static IEnumerator AnimationCollapseVertical(Notify notify)
 {
     return(AnimationCollapseBase(notify, false, 200f));
 }
		void ReturnNotify(Notify notify)
		{
			notify.Return();
		}
Example #22
0
 /// <summary>
 /// Horizontal collapse animation.
 /// </summary>
 /// <param name="notify">Notify.</param>
 /// <returns>Returns animations.</returns>
 public static IEnumerator AnimationCollapseHorizontal(Notify notify)
 {
     return(AnimationCollapseBase(notify, true, 200f));
 }
Example #23
0
 public static IEnumerator AnimationCollapseUnscaledTime(Notify notify)
 {
     return(AnimationCollapse(notify));
 }
Example #24
0
 /// <summary>
 /// Slide animation to left.
 /// </summary>
 /// <param name="notify">Notify.</param>
 /// <returns>Animation.</returns>
 public static IEnumerator AnimationSlideLeft(Notify notify)
 {
     return(AnimationSlideBase(notify, true, -1f, 200f));
 }
		IEnumerator NextDelay()
		{
			yield return new WaitForSeconds(notifySequence[0].SequenceDelay);
			currentNotify = null;
		}
Example #26
0
 // Token: 0x060048DE RID: 18654 RVA: 0x00185BB7 File Offset: 0x00183FB7
 private void OnDisable()
 {
     Notify.FreeSlide(this.rect);
 }