Skip to content

Commit

Permalink
bump animation
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin committed Oct 13, 2016
1 parent 596bc92 commit fbdea86
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions components/animation/dist/aframe-animation-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,26 @@

playAnimation: function () {
if (!this.animation) { return; }
var updateConfig = configDefault;
var propType = getPropertyType(this.el, this.data.property);
if (propType === 'vec2' || propType === 'vec3' || propType === 'vec4') {
updateConfig = configVector;
}
this.config = updateConfig(this.el, this.data, this.config);
this.animation = anime(this.config);
this.animation.restart();
this.animationIsPlaying = true;
},

pauseAnimation: function () {
if (!this.animation) { return; }
var updateConfig = configDefault;
var propType = getPropertyType(this.el, this.data.property);
if (propType === 'vec2' || propType === 'vec3' || propType === 'vec4') {
updateConfig = configVector;
}
this.config = updateConfig(this.el, this.data, this.config);
this.animation = anime(this.config);
this.animation.pause();
this.animationIsPlaying = false;
}
Expand Down
Loading

0 comments on commit fbdea86

Please sign in to comment.