Commit 23ab9dc5 authored by Georg Schäfer's avatar Georg Schäfer

Add character dash animation.

parent c4fa7e6c
{
"Transform": {
"scale": {
"x": 1.5,
"y": 1.5,
"z": 1.5
"x": 0.015,
"y": 0.015,
"z": 0.015
}
},
"Model": {
......
No preview for this file type
......@@ -84,7 +84,8 @@ namespace phase_shifter::gameplay {
_bus.send<Play_sound_msg>("dash"_strid);
}
entity.process([](mirrage::renderer::Simple_animation_controller_comp& controller) {
controller.play("dash"_strid);
controller.play("dash"_strid, 1.5f, false, false, true);
controller.fade_time(0.0001f);
});
}
......@@ -126,6 +127,15 @@ namespace phase_shifter::gameplay {
transform.position.x = pos.x + offset.x;
transform.position.z = pos.y + offset.y;
} else {
entity.process([](mirrage::renderer::Simple_animation_controller_comp& controller) {
controller.current().process([&](mirrage::renderer::Animation_state& state) {
auto time_left = state.animation->duration() - state.time;
if(state.animation_id == "dash"_strid && time_left <= 0.1f) {
controller.play("idle"_strid);
}
});
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment