Browse Source

fix createFromSnippetAsync for particle

David `Deltakosh` Catuhe 4 năm trước cách đây
mục cha
commit
2978c14fff
2 tập tin đã thay đổi với 1704 bổ sung3 xóa
  1. 1700 1
      dist/preview release/babylon.ktx2Decoder.js
  2. 4 2
      src/Particles/particleHelper.ts

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1700 - 1
dist/preview release/babylon.ktx2Decoder.js


+ 4 - 2
src/Particles/particleHelper.ts

@@ -166,8 +166,10 @@ export class ParticleHelper {
      * @returns a promise that will resolve to the new particle system
      */
     public static CreateFromSnippetAsync(snippetId: string, scene: Scene, gpu: boolean = false, rootUrl: string = ""): Promise<IParticleSystem> {
-        if (snippetId === "_BLANK") {
-            return Promise.resolve(this.CreateDefault(null));
+        if (snippetId === "_BLANK") {        
+            let system = this.CreateDefault(null);
+            system.start();
+            return Promise.resolve(system);
         }
 
         return new Promise((resolve, reject) => {