فهرست منبع

Particle System Dependencies

sebavan 6 سال پیش
والد
کامیت
19a86e49b1
3فایلهای تغییر یافته به همراه14 افزوده شده و 11 حذف شده
  1. 1 7
      Tools/Config/tempCircularValidation/core.json
  2. 2 0
      src/Particles/particleSystem.ts
  3. 11 4
      src/Particles/subEmitter.ts

+ 1 - 7
Tools/Config/tempCircularValidation/core.json

@@ -2,14 +2,8 @@
     "../../src/Particles/particleHelper.ts": [
         "../../src/Particles/particleSystemSet.ts"
     ],
-    "../../src/Particles/particleSystem.ts": [
-        "../../src/Particles/subEmitter.ts"
-    ],
     "../../src/Particles/particleSystemSet.ts": [
         "../../src/Particles/particleHelper.ts"
     ],
-    "../../src/Particles/subEmitter.ts": [
-        "../../src/Particles/particleSystem.ts"
-    ],
-    "errorCount": 4
+    "errorCount": 2
 }

+ 2 - 0
src/Particles/particleSystem.ts

@@ -2581,3 +2581,5 @@ import "../Shaders/particles.vertex";
             return particleSystem;
         }
     }
+
+    SubEmitter._ParseParticleSystem = ParticleSystem.Parse;

+ 11 - 4
src/Particles/subEmitter.ts

@@ -1,9 +1,11 @@
 import { Vector3 } from "../Maths/math";
 import { AbstractMesh } from "../Meshes/abstractMesh";
 import { Mesh } from "../Meshes/mesh";
-import { ParticleSystem } from "../Particles/particleSystem";
-import { Scene } from "../scene";
-    /**
+
+declare type Scene = import("../scene").Scene;
+declare type ParticleSystem = import("../Particles/particleSystem").ParticleSystem;
+
+/**
      * Type of sub emitter
      */
     export enum SubEmitterType {
@@ -98,6 +100,11 @@ import { Scene } from "../scene";
             return serializationObject;
         }
 
+        /** @hidden */
+        public static _ParseParticleSystem(system: any, scene: Scene, rootUrl: string): ParticleSystem {
+            throw "Import ParseParticle before parsing SubEmitter.";
+        }
+
         /**
          * Creates a new SubEmitter from a serialized JSON version
          * @param serializationObject defines the JSON object to read from
@@ -107,7 +114,7 @@ import { Scene } from "../scene";
          */
         public static Parse(serializationObject: any, scene: Scene, rootUrl: string): SubEmitter {
             let system = serializationObject.particleSystem;
-            let subEmitter = new SubEmitter(ParticleSystem.Parse(system, scene, rootUrl));
+            let subEmitter = new SubEmitter(SubEmitter._ParseParticleSystem(system, scene, rootUrl));
             subEmitter.type = serializationObject.type;
             subEmitter.inheritDirection = serializationObject.inheritDirection;
             subEmitter.inheritedVelocityAmount = serializationObject.inheritedVelocityAmount;