void ChangeState() { if (mPursuitType != PursuitType.PursuitType_Attack) { mObjAttackComponent.StopAttack(); } switch (mPursuitType) { case PursuitType.PursuitType_Wait: mObjAnimatorComponent.Stand(); break; case PursuitType.PursuitType_Pursuit: mObjMoveComponent.MoveToTarget(mPursuitTarget, OnArrive); break; case PursuitType.PursuitType_Attack: mObjAttackComponent.DoAttack(mPursuitTarget); break; case PursuitType.PursuitType_Back: mPursuitTarget = null; mObjMoveComponent.mMoveTarget = null; mObjMoveComponent.MoveToPos(mObjInitPosition, OnArrive); break; default: break; } }