animationPlayer property
ComponentSchema<AnimationPlayerComponent>
get
animationPlayer
Implementation
static ComponentSchema<AnimationPlayerComponent> get animationPlayer =>
ComponentSchema<AnimationPlayerComponent>(
type: 'AnimationPlayerComponent',
id: 'animation_player_3d_91d6a2c4',
create: AnimationPlayerComponent.new,
hints: const ComponentHints(
dimensions: Dimensions.threeD,
name: 'Animation Player',
group: '3D',
description: "Plays the model's animations (glTF clips).",
icon: Icons.directions_run,
accentColor: Color(0xFFAB47BC),
fields: {
'clip': FieldHint(label: 'Clip'),
'speed': FieldHint(
label: 'Speed',
scrub: ScrubHint(step: 0.05, fractionDigits: 2),
),
'loop': FieldHint(label: 'Loop'),
'playing': FieldHint(label: 'Playing'),
'crossfade': FieldHint(
label: 'Crossfade',
scrub: ScrubHint(step: 0.05, fractionDigits: 2, suffix: 's'),
),
},
),
fields: [
SchemaField(
name: 'clip',
kind: FieldTypes.text,
read: (c) => (c as AnimationPlayerComponent).clip,
write: (c, v) =>
(c as AnimationPlayerComponent).clip = v as String? ?? '',
),
_decimal(
'speed',
(c) => (c as AnimationPlayerComponent).speed,
(c, v) => (c as AnimationPlayerComponent).speed = v,
),
SchemaField(
name: 'loop',
kind: FieldTypes.boolean,
read: (c) => (c as AnimationPlayerComponent).loop,
write: (c, v) => (c as AnimationPlayerComponent).loop = v as bool,
),
SchemaField(
name: 'playing',
kind: FieldTypes.boolean,
read: (c) => (c as AnimationPlayerComponent).playing,
write: (c, v) =>
(c as AnimationPlayerComponent).playing = v as bool,
),
_decimal(
'crossfade',
(c) => (c as AnimationPlayerComponent).crossfade,
(c, v) => (c as AnimationPlayerComponent).crossfade = v,
min: 0,
),
],
);