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