/// <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);
		}
Esempio n. 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);
 }
Esempio n. 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));
 }
Esempio n. 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;
        }
Esempio n. 9
0
 public static IEnumerator AnimationRotateUnscaledTime(Notify notify)
 {
     return(AnimationRotate(notify));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 12
0
 public static IEnumerator AnimationRotate(Notify notify)
 {
     return(AnimationRotateVertical(notify));
 }
Esempio n. 13
0
 static void AddCloseCallback(Notify notify)
 {
     if (notify.hideButton==null)
     {
         return ;
     }
     notify.hideButton.onClick.AddListener(notify.Hide);
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 16
0
 /// <summary>
 /// Handle disable event.
 /// </summary>
 protected virtual void OnDisable()
 {
     Notify.FreeSlide(rect);
 }
 void ReturnNotify(Notify notify)
 {
     notify.Return();
 }
Esempio n. 18
0
 public static IEnumerator AnimationCollapse(Notify notify)
 {
     return(AnimationCollapseVertical(notify));
 }
Esempio n. 19
0
 void OnDisable()
 {
     Notify.FreeSlide(rect);
 }
Esempio n. 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();
		}
Esempio n. 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));
 }
Esempio n. 23
0
 public static IEnumerator AnimationCollapseUnscaledTime(Notify notify)
 {
     return(AnimationCollapse(notify));
 }
Esempio n. 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;
		}
Esempio n. 26
0
 // Token: 0x060048DE RID: 18654 RVA: 0x00185BB7 File Offset: 0x00183FB7
 private void OnDisable()
 {
     Notify.FreeSlide(this.rect);
 }