-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloop.js
43 lines (39 loc) · 1.39 KB
/
loop.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function update() {
for(var i=0; i < objects.length; i++)
if(
objects[i] &&
objects[i].ayceUI.runScriptInPreview &&
objects[i].ayceUI.runInitScript &&
typeof objects[i].initScript == "function" &&
typeof objects[i].updateScript == "function" // if script is of type string the code has errors
) {
objects[i].initScript();
objects[i].ayceUI.runInitScript = false;
}
for(i=0; i < objects.length; i++) {
if (
objects[i] &&
objects[i].ayceUI.runScriptInPreview &&
typeof objects[i].initScript == "function" &&
typeof objects[i].updateScript == "function" // if script is of type string the code has errors
) {
objects[i].updateScript();
}
}
Ayce.requestAnimFrame(update);
if(renderScene) {
scene.updateScene();
scene.drawScene();
}
if(cameraPreview.renderPreview){
if(cameraPreview.modifier.ayceUI.runScriptInPreview) {
if (cameraPreview.modifier.ayceUI.runScriptInPreview && cameraPreview.modifier.ayceUI.runInitScript) {
cameraPreview.modifier.initScript();
cameraPreview.modifier.ayceUI.runInitScript = false;
}
cameraPreview.modifier.updateScript();
}
cameraPreview.update();
}
}
update();