zhengchen hace 1 año
padre
commit
8a94fd5680
Se han modificado 1 ficheros con 7 adiciones y 10 borrados
  1. 7 10
      Assets/Scripts/Game/GameCore.cs

+ 7 - 10
Assets/Scripts/Game/GameCore.cs

@@ -79,12 +79,11 @@ namespace Game
             cockDict = new Dictionary<int, CockActionComp>();
             masterDict = new Dictionary<int, MasterActionComp>();
 
-            var battleDetailList = jsonLogs;
-            winPlayerId = battleDetailList.winPlayer;
-            diamond = battleDetailList.diamond;
-            Array.Sort(battleDetailList.logArray, (obj1, obj2) => obj1.index.CompareTo(obj2.index));
+            winPlayerId = jsonLogs.winPlayer;
+            diamond = jsonLogs.diamond;
+            Array.Sort(jsonLogs.logArray, (obj1, obj2) => obj1.index.CompareTo(obj2.index));
             battleDetailObjs = new LinkedList<BattleDetailObj>();
-            foreach (var log in battleDetailList.logArray)
+            foreach (var log in jsonLogs.logArray)
             {
                 battleDetailObjs.AddFirst(log);
             }
@@ -140,11 +139,9 @@ namespace Game
 
             if (masterBack.Item1 && masterBack.Item2)
             {
-                if (currentState == liftState)
-                {
-                    masterBack = (false, false);
-                    TransitionToState(battleState);
-                }
+                if (currentState != liftState) return;
+                masterBack = (false, false);
+                TransitionToState(battleState);
             }
         }
     }