소스 검색

出怪endTime可以为0

wgl 7 달 전
부모
커밋
103a65c84f
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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));
         }
     }