feat: simplifying enemy state logic
This commit is contained in:
parent
603b3afcc2
commit
710e9c7bde
6 changed files with 148 additions and 154 deletions
|
|
@ -53,24 +53,8 @@ AnimationPlayer *EnemyRifleman::get_anim() const {
|
|||
return this->anim;
|
||||
}
|
||||
|
||||
void RiflemanState::set_target(Node *node) {
|
||||
this->target = cast_to<EnemyRifleman>(node);
|
||||
}
|
||||
|
||||
EnemyRifleman *RiflemanState::get_target() const {
|
||||
return this->target;
|
||||
}
|
||||
|
||||
NpcUnit *RiflemanState::get_unit() const {
|
||||
return this->target->get_unit();
|
||||
}
|
||||
|
||||
NavigationAgent3D *RiflemanState::get_nav() const {
|
||||
return this->target->get_nav();
|
||||
}
|
||||
|
||||
AnimationPlayer *RiflemanState::get_anim() const {
|
||||
return this->target->get_anim();
|
||||
return cast_to<EnemyRifleman>(get_body());
|
||||
}
|
||||
|
||||
void RiflemanPatrolState::enter_state() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue