From 11bfdbdbdfdeec58bf5099cb4c508f3cbc6dda77 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 04 四月 2019 16:22:21 +0800
Subject: [PATCH] 3335 缥缈仙域

---
 System/HazyRegion/HazyRegionWin.cs          |    2 +-
 System/HazyRegion/HazyRegionCyclicScroll.cs |   17 ++++++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/System/HazyRegion/HazyRegionCyclicScroll.cs b/System/HazyRegion/HazyRegionCyclicScroll.cs
index 70e6754..8987186 100644
--- a/System/HazyRegion/HazyRegionCyclicScroll.cs
+++ b/System/HazyRegion/HazyRegionCyclicScroll.cs
@@ -9,22 +9,30 @@
 
         public bool IsPlaying { get; private set; }
 
+        Coroutine m_Coroutine = null;
+
         public override void Init<T>(List<T> _datas, bool _stepByStep = false)
         {
             base.Init(_datas, _stepByStep);
             IsPlaying = false;
             this.enabled = true;
+
+            if (m_Coroutine != null)
+            {
+                StopCoroutine(m_Coroutine);
+                m_Coroutine = null;
+            }
         }
 
-        public void StartEnterAnmation()
+        public void DisplayAnimation()
         {
             IsPlaying = true;
             this.enabled = false;
 
-            StartCoroutine(Co_EnterAnimation());
+            m_Coroutine = StartCoroutine(Co_DisplayAnimation());
         }
 
-        IEnumerator Co_EnterAnimation()
+        IEnumerator Co_DisplayAnimation()
         {
             for (int i = 0; i < infiniteItems.Count; i++)
             {
@@ -50,7 +58,10 @@
                 time = behaviour.alphaTween.duration - m_FadeInTime;
             }
 
+            time = Mathf.Max(0, time);
+
             yield return WaitingForSecondConst.GetWaitForSeconds(time);
+
             IsPlaying = false;
             this.enabled = true;
         }
diff --git a/System/HazyRegion/HazyRegionWin.cs b/System/HazyRegion/HazyRegionWin.cs
index 2c89290..ffa54dc 100644
--- a/System/HazyRegion/HazyRegionWin.cs
+++ b/System/HazyRegion/HazyRegionWin.cs
@@ -35,7 +35,7 @@
         protected override void OnActived()
         {
             base.OnActived();
-            m_EventCyclicScroll.StartEnterAnmation();
+            m_EventCyclicScroll.DisplayAnimation();
         }
 
         protected override void OnAfterOpen()

--
Gitblit v1.8.0