content/hifi-content/thoys/dev/2018/dance/dance.js
2022-02-14 02:04:11 +01:00

22 lines
932 B
JavaScript

(function () {
return {
preload: function(entityID) {
this.animationProperties = JSON.parse(Entities.getEntityProperties(entityID, 'userData').userData).animation;
},
clickDownOnEntity: function() {
this.dancing = !this.dancing;
if (this.dancing) {
/*this.animationProperties = {
url: "https://hifi-content.s3.amazonaws.com/animations/Dancing.fbx",
fps: 34,
loop: true,
firstFrame: 0,
lastFrame: 243
};*/
MyAvatar.overrideAnimation(this.animationProperties.url, this.animationProperties.fps, this.animationProperties.loop, this.animationProperties.firstFrame, this.animationProperties.lastFrame);
} else {
MyAvatar.restoreAnimation();
}
}
};
});