repo: janusweb action: commit revision: path_from: revision_from: 1a6a2b0af19b8afe562f90f652e4e26e6239e33f: path_to: revision_to:
commit 1a6a2b0af19b8afe562f90f652e4e26e6239e33f Author: James BaicoianuDate: Fri Oct 20 00:11:28 2017 -0700 Handle anim_id changes from scripts diff --git a/scripts/janusbase.js b/scripts/janusbase.js
--- a/scripts/janusbase.js
+++ b/scripts/janusbase.js
@@ -29,7 +29,7 @@ elation.require(['engine.things.generic', 'utils.template'], function() {
rotate_axis: { type: 'string', default: '0 1 0' },
rotate_deg_per_sec: { type: 'string' },
onclick: { type: 'object' },
- anim_id: { type: 'string' },
+ anim_id: { type: 'string', set: this.updateAnimation },
anim_transition_time: { type: 'float', default: .2 },
collision_id: { type: 'string', set: this.updateCollider },
collision_pos: { type: 'vector3', default: new THREE.Vector3(0,0,0), set: this.updateCollider },
@@ -443,6 +443,10 @@ console.error('dunno what this is', other);
});
}
}
+ this.updateAnimation = function() {
+ // Triggered whenever this.anim_id changes
+ this.setAnimation(this.anim_id);
+ }
this.setAnimation = function(anim_id) {
if (!this.activeanimation || anim_id != this.anim_id) {
if (!this.animationmixer) return;
-----END OF PAGE-----