Przeglądaj źródła

setTimeout to window.setTimeout

Gary Hsu 6 lat temu
rodzic
commit
ea8e72f2f2
1 zmienionych plików z 5 dodań i 5 usunięć
  1. 5 5
      src/babylon.scene.ts

+ 5 - 5
src/babylon.scene.ts

@@ -2389,7 +2389,7 @@
         private _executeOnceBeforeRender(func: () => void): void {
             let execFunc = () => {
                 func();
-                setTimeout(() => {
+                window.setTimeout(() => {
                     this.unregisterBeforeRender(execFunc);
                 });
             }
@@ -2405,7 +2405,7 @@
          */
         public executeOnceBeforeRender(func: () => void, timeout?: number): void {
             if (timeout !== undefined) {
-                setTimeout(() => {
+                window.setTimeout(() => {
                     this._executeOnceBeforeRender(func);
                 }, timeout);
             } else {
@@ -2458,9 +2458,9 @@
                 return;
             }
 
-            //this._executeWhenReadyTimeoutId = setTimeout(() => {
+            this._executeWhenReadyTimeoutId = window.setTimeout(() => {
                 this._checkIsReady();
-            //}, 150);
+            }, 150);
         }
 
         /**
@@ -2487,7 +2487,7 @@
                 return;
             }
 
-            this._executeWhenReadyTimeoutId = setTimeout(() => {
+            this._executeWhenReadyTimeoutId = window.setTimeout(() => {
                 this._checkIsReady();
             }, 150);
         }