|
|
## Playing an animation
|
|
|
```<placeholder>
|
|
|
```java
|
|
|
// Get a hold of the ActiveModel you want to modify
|
|
|
ActiveModel model = ...
|
|
|
// Get the model's AnimationHandler
|
... | ... | @@ -9,7 +9,7 @@ handler.playAnimation("attack", 0.3, 0.3, 1, true); |
|
|
```
|
|
|
|
|
|
## Stopping an animation with transition
|
|
|
```<placeholder>
|
|
|
```java
|
|
|
ActiveModel model = ...
|
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
|
// Stop an animation. The model will transition out of the animation smoothly
|
... | ... | @@ -17,7 +17,7 @@ handler.stopAnimation("eating"); |
|
|
```
|
|
|
|
|
|
## Stopping an animation immediately
|
|
|
```<placeholder>
|
|
|
```java
|
|
|
ActiveModel model = ...
|
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
|
// Stop an animation. The model will snap right out of the animation
|
... | ... | @@ -25,7 +25,7 @@ handler.forceStopAnimation("eating"); |
|
|
```
|
|
|
|
|
|
## Using specific animation handler method
|
|
|
```<placeholder>
|
|
|
```java
|
|
|
ActiveModel model = ...
|
|
|
AnimationHandler handler = model.getAnimationHandler();
|
|
|
if(handler instanceof IStateMachineHandler stateMachineHandler) {
|
... | ... | |