Ver código fonte

出怪endTime可以为0

wgl 7 meses atrás
pai
commit
103a65c84f
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      ActionTowerDefense/Assets/Scripts/EnemyCreater.cs

+ 4 - 0
ActionTowerDefense/Assets/Scripts/EnemyCreater.cs

@@ -139,6 +139,10 @@ public class EnemyCreater : MonoBehaviour
                 return;
             }
             float TimeInterval = (float)(spawnTime.endTime - spawnTime.startTime) / (spawnTime.num - 1);
+            if (TimeInterval <= 0)
+            {
+                return;
+            }
             await Task.Delay((int)(TimeInterval * 1000));
         }
     }