mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:29:03 +02:00
number of frames on cuckoo animation is high
This commit is contained in:
parent
bf30102534
commit
e39df5fdba
1 changed files with 22 additions and 4 deletions
|
@ -16,13 +16,31 @@
|
||||||
|
|
||||||
preload: function(entityID) {
|
preload: function(entityID) {
|
||||||
_this.entityID = entityID; // this.animation.isRunning = true;
|
_this.entityID = entityID; // this.animation.isRunning = true;
|
||||||
var userData = getEntityUserData(entityID);
|
_this.userData = getEntityUserData(entityID);
|
||||||
var clockBody = userData.clockBody;
|
|
||||||
// print("ANIMATION!!! " + JSON.stringify(_this.animationURL));
|
// print("ANIMATION!!! " + JSON.stringify(_this.animationURL));
|
||||||
Entities.editEntity(_this.entityID, {animation: {running: true}})
|
if (!_this.userData || !_this.userData.clockBody) {
|
||||||
|
print("THIS CLOCK HAND IS NOT ATTACHED TO A CLOCK BODY!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_this.clockBody = _this.userData.clockBody;
|
||||||
|
Entities.editEntity(_this.clockBody, {animation: {running: true}});
|
||||||
|
Script.update.connect(_this.update);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
unload: function() {
|
||||||
|
Script.update.disconnect(_this.update);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
update: function() {
|
||||||
|
_this.clockBodyAnimationProps = Entities.getEntityProperties(_this.clockBody, "animation").animation;
|
||||||
|
if (!_this.clockBodyAnimationProps) {
|
||||||
|
print("NO CLOCK BODY ANIMATION PROPS! RETURNING");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
print("current Frame " + _this.clockBodyAnimationProps.currentFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue