playAnimationByName method
Future
playAnimationByName(
- ThermionEntity entity,
- String name, {
- bool loop = false,
- bool reverse = false,
- bool replaceActive = true,
- double crossfade = 0.0,
override
Schedules the glTF animation at index
in entity
to start playing on the next frame.
Implementation
@override
Future playAnimationByName(ThermionEntity entity, String name,
{bool loop = false,
bool reverse = false,
bool replaceActive = true,
double crossfade = 0.0}) async {
final animationNames = await getAnimationNames(entity);
final index = animationNames.indexOf(name);
if (index == -1) {
throw Exception("Animation ${name} not found.");
}
return playAnimation(entity, index,
loop: loop,
reverse: reverse,
replaceActive: replaceActive,
crossfade: crossfade);
}