playAnimationByName method
Future
playAnimationByName(
- ThermionEntity entity,
- String name, {
- bool loop = false,
- bool reverse = false,
- bool replaceActive = true,
- double crossfade = 0.0,
- bool wait = false,
override
Implementation
@override
Future playAnimationByName(ThermionEntity entity, String name,
{bool loop = false,
bool reverse = false,
bool replaceActive = true,
double crossfade = 0.0,
bool wait = false}) async {
var animations = await getAnimationNames(entity);
var index = animations.indexOf(name);
var duration = await getAnimationDuration(entity, index);
await playAnimation(entity, index,
loop: loop,
reverse: reverse,
replaceActive: replaceActive,
crossfade: crossfade);
if (wait) {
await Future.delayed(Duration(milliseconds: (duration * 1000).toInt()));
}
}