From 4f708a649f8d7ec4c07de84ec7547a70f13080bf Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期四, 25 四月 2019 19:45:20 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/MainInterfacePanel/TaskModel.cs |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/System/MainInterfacePanel/TaskModel.cs b/System/MainInterfacePanel/TaskModel.cs
index efaa124..a6faf4e 100644
--- a/System/MainInterfacePanel/TaskModel.cs
+++ b/System/MainInterfacePanel/TaskModel.cs
@@ -138,6 +138,7 @@
     private int NeedWaitTime = 4;
 
     private float mainTaskAutoWaitTime = 0f;
+    public readonly TaskWait taskWait = new TaskWait();
 
     PackModel _playerPack;
     PackModel playerPack
@@ -254,6 +255,7 @@
                 if (allMissionDict[MissionID].MissionState != MissionState && MissionState == 3 && AutomaticityBool)
                 {
                     TaskOverBool = true;
+                    taskWait.Push(TaskWaitType.TaskComplete);
                     if (CompletionOfTaskEvent != null)
                     {
                         CompletionOfTaskEvent(MissionID);
@@ -1361,7 +1363,10 @@
 
         if (MainTaskDic.ContainsKey(_taskID))//涓荤嚎绛夊緟琛ㄧ幇
         {
-            yield return WaitingForSecondConst.GetWaitForSeconds(mainTaskAutoWaitTime);
+            if (taskWait.wait)
+            {
+                yield return WaitingForSecondConst.GetWaitForSeconds(mainTaskAutoWaitTime);
+            }
         }
 
         if (GA_Hero.s_MapSwitching)
@@ -1682,4 +1687,37 @@
             TaskAllocation.Instance.TaskTime = TimeUtility.ServerNow;
         }
     }
+
+    public class TaskWait
+    {
+        public bool wait
+        {
+            get
+            {
+                foreach (var key in taskWaits.Keys)
+                {
+                    if ((TimeUtility.ServerNow - taskWaits[key]).TotalSeconds < 1f)
+                    {
+                        return true;
+                    }
+                }
+                return false;
+            }
+        }
+
+        Dictionary<TaskWaitType, DateTime> taskWaits = new Dictionary<TaskWaitType, DateTime>();
+
+        public void Push(TaskWaitType type)
+        {
+            taskWaits[type] = TimeUtility.ServerNow;
+        }
+    }
+
+    public enum TaskWaitType
+    {
+        TaskComplete,
+        LevelUp,
+        TreasureProgress,
+        BetterEquip,
+    }
 }

--
Gitblit v1.8.0