Преглед на файлове

Editor: Wait for storage before initialising agent.

Mr.doob преди 1 година
родител
ревизия
b4b3e0c860
променени са 2 файла, в които са добавени 7 реда и са изтрити 1 реда
  1. 2 0
      editor/index.html
  2. 5 1
      editor/js/Agent.js

+ 2 - 0
editor/index.html

@@ -129,6 +129,8 @@
 
 
 					}
 					}
 
 
+					editor.signals.storageLoaded.dispatch();
+
 				} );
 				} );
 
 
 				//
 				//

+ 5 - 1
editor/js/Agent.js

@@ -27,7 +27,11 @@ class Agent {
 		this.generateRandomColor = this.generateRandomColor.bind( this );
 		this.generateRandomColor = this.generateRandomColor.bind( this );
 		this.generateUniqueObjectName = this.generateUniqueObjectName.bind( this );
 		this.generateUniqueObjectName = this.generateUniqueObjectName.bind( this );
 
 
-		this.init();
+		this.editor.signals.storageLoaded.add( () => {
+
+			this.init();
+
+		} );
 
 
 	}
 	}
 
 

粤ICP备19079148号