TESTANIMATION: added ent type cycling
parent
12a7603dc1
commit
df2a2bc23d
|
@ -2,5 +2,7 @@ space "animation_cycle 1"
|
|||
ctrl+space "animation_cycle -1"
|
||||
e "animation_cycle 1"
|
||||
q "animation_cycle -1"
|
||||
y "animation_cycleenttype 1"
|
||||
c "animation_cycleenttype -1"
|
||||
r "animation_cycletype 1"
|
||||
t "animation_cycletype -1"
|
||||
|
|
|
@ -64,6 +64,21 @@ core::AppState TestAnimation::onConstruct() {
|
|||
animationEntity()->setAnimation((animation::Animation)_animationIdx);
|
||||
});
|
||||
|
||||
core::Command::registerCommand("animation_cycleenttype", [this] (const core::CmdArgs& argv) {
|
||||
int offset = 1;
|
||||
if (argv.size() > 0) {
|
||||
offset = core::string::toInt(argv[0]);
|
||||
}
|
||||
int current = (int)_entityType;
|
||||
current += offset;
|
||||
while (current < 0) {
|
||||
current += std::enum_value(EntityType::Max);
|
||||
}
|
||||
current %= (int)EntityType::Max;
|
||||
_entityType = (EntityType)current;
|
||||
loadAnimationEntity();
|
||||
});
|
||||
|
||||
core::Command::registerCommand("animation_cycletype", [this] (const core::CmdArgs& argv) {
|
||||
int offset = 1;
|
||||
if (argv.size() > 0) {
|
||||
|
|
Loading…
Reference in New Issue