add looping to animation debug widget
This commit is contained in:
@@ -66,15 +66,38 @@ class _EntityListWidget extends State<EntityListWidget> {
|
|||||||
SubmenuButton(
|
SubmenuButton(
|
||||||
child: const Text("Animations"),
|
child: const Text("Animations"),
|
||||||
menuChildren: animations.data!
|
menuChildren: animations.data!
|
||||||
.map((a) => MenuItemButton(
|
.map((a) => SubmenuButton(
|
||||||
child: Text(a),
|
child: Text(a),
|
||||||
onPressed: () async {
|
menuChildren: [
|
||||||
await widget.controller!
|
MenuItemButton(
|
||||||
.addAnimationComponent(entity);
|
child: Text("Play"),
|
||||||
widget.controller!.playAnimation(
|
onPressed: () async {
|
||||||
entity, animations.data!.indexOf(a));
|
await widget.controller!
|
||||||
},
|
.addAnimationComponent(entity);
|
||||||
))
|
widget.controller!.playAnimation(entity,
|
||||||
|
animations.data!.indexOf(a));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
MenuItemButton(
|
||||||
|
child: Text("Loop"),
|
||||||
|
onPressed: () async {
|
||||||
|
await widget.controller!
|
||||||
|
.addAnimationComponent(entity);
|
||||||
|
widget.controller!.playAnimation(
|
||||||
|
entity, animations.data!.indexOf(a),
|
||||||
|
loop: true);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
MenuItemButton(
|
||||||
|
child: Text("Stop"),
|
||||||
|
onPressed: () async {
|
||||||
|
await widget.controller!
|
||||||
|
.addAnimationComponent(entity);
|
||||||
|
widget.controller!.stopAnimation(
|
||||||
|
entity, animations.data!.indexOf(a));
|
||||||
|
},
|
||||||
|
)
|
||||||
|
]))
|
||||||
.toList()),
|
.toList()),
|
||||||
ChildRenderableWidget(
|
ChildRenderableWidget(
|
||||||
controller: widget.controller!, entity: entity),
|
controller: widget.controller!, entity: entity),
|
||||||
|
|||||||
Reference in New Issue
Block a user