Skip to content

Commit

Permalink
allow removing animation from AnimationsPlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsx-dev committed Mar 30, 2021
1 parent 62da325 commit c8047c2
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.mgsx.gltf.scene3d.animation;

import com.badlogic.gdx.graphics.g3d.model.Animation;
import com.badlogic.gdx.graphics.g3d.utils.AnimationController;
import com.badlogic.gdx.graphics.g3d.utils.AnimationController.AnimationDesc;
import com.badlogic.gdx.utils.Array;
Expand Down Expand Up @@ -27,6 +28,14 @@ public void addAnimation(AnimationDesc animation){
c.setAnimationDesc(animation);
controllers.add(c);
}
public void removeAnimation(Animation animation){
for(int i=controllers.size-1 ; i>=0 ; i--){
if(controllers.get(i).current != null && controllers.get(i).current.animation == animation){
controllers.removeIndex(i);
}
}
}

public void clearAnimations(){
controllers.clear();
if(scene.animationController != null){
Expand Down

0 comments on commit c8047c2

Please sign in to comment.