|
@@ -1,4 +1,4 @@
|
|
|
-import { assetManager, instantiate, Prefab, Node, UITransform, Vec3, Vec2, view, game, PhysicsSystem, geometry } from "cc";
|
|
|
+import { assetManager, instantiate, Prefab, Node, UITransform, Vec3, Vec2, view, game, PhysicsSystem, geometry, isValid } from "cc";
|
|
|
import { resLoader } from "db://assets/core_tgx/base/ResLoader";
|
|
|
import { StormSunderGlobalInstance } from "../StormSunderGlobalInstance";
|
|
|
import { TornadoComponent } from "../Component/TornadoComponent";
|
|
@@ -102,8 +102,8 @@ export class PropMgr {
|
|
|
if (!this.tornadoNode) return;
|
|
|
|
|
|
let playerPos = this.tornadoNode.worldPosition;
|
|
|
- let angle = Math.random() * Math.PI * 2; // 随机角度
|
|
|
|
|
|
+ let angle = Math.random() * Math.PI * 2; // 随机角度
|
|
|
let distance = Math.random() * this.spawnRadius + this.spawnRadius;
|
|
|
let x = playerPos.x + Math.cos(angle) * distance;
|
|
|
let z = playerPos.z + Math.sin(angle) * distance;
|