Example #1
0
 public IEnumerator OnRotateOfAction()
 {
     EnemyActionController.ActionInfo actInfo = enemyBrain.actionCtrl.nowAction;
     if (actInfo.data.isRotate)
     {
         yield return((object)this.StartCoroutine(OnRotateToTarget()));
     }
 }
Example #2
0
 public IEnumerator OnMoveOfAction()
 {
     EnemyActionController.ActionInfo actInfo = enemyBrain.actionCtrl.nowAction;
     if (actInfo.data.isMove && !(base.brain.targetCtrl.GetDistance() < (float)actInfo.data.atkRange))
     {
         if (base.brain.param.moveParam.enableActionMoveHoming)
         {
             yield return((object)this.StartCoroutine(OnMoveHoming()));
         }
         else
         {
             yield return((object)this.StartCoroutine(OnMoveToTarget()));
         }
     }
 }
    public override void Enter(StateMachine fsm, Brain brain)
    {
        EnemyBrain enemyBrain = brain as EnemyBrain;

        EnemyActionController.ActionInfo nowAction = enemyBrain.actionCtrl.nowAction;
        if (nowAction.data.isRotate)
        {
            fsm.subFsm.ChangeState(STATE_TYPE.ROTATE);
        }
        else if (nowAction.data.isMove)
        {
            fsm.subFsm.ChangeState(STATE_TYPE.MOVE);
        }
        else
        {
            fsm.subFsm.ChangeState(STATE_TYPE.ATTACK);
        }
    }