void State_Attack_Focus::OnEnter(void) { std::cout << "OnEnter Attack Focus\n"; Unit* u; Game* gm; gm = Game::GetInstance(); u = this->_motherMachine->GetUnit(); this->targetUnit = u->GetTargetAttackUnit(); if (this->targetUnit != NULL) { if (u->GetAttackHandler()->CanAttack(this->targetUnit) == false) this->__BackToParent(); } else this->__BackToParent(); }