示例#1
0
        public override void process(BossSM fsm)
        {
            if (fsm.unit.HorizonSpeed == 0)
            {
                fsm.anim.SetSpeed(1);
                fsm.anim.ChangeAnim(BossAnim.Idle);
            }
            else
            {
                fsm.anim.SetSpeed(fsm.unit.HorizonSpeed / fsm.unit.stat.moveSpeed);
                fsm.anim.ChangeAnim(BossAnim.Walk);
            }

            if (fsm.CheckAttackable())
            {
                fsm.ChangeState(_attackList[fsm.CurPhase][_curAttackOrder]);
                _curAttackOrder++;
                return;
            }

            fsm.SetDirection(fsm.unit.Target.transform.position.x > fsm.unit.transform.position.x);

            if (fsm.doesLookRight())
            {
                fsm.unit.Move(1);
            }
            else
            {
                fsm.unit.Move(-1);
            }
        }
示例#2
0
        public override void process(BossSM fsm)
        {
            if (fsm.IsAttacked)
            {
                float   deltaX;
                Vector3 pos = fsm.unit.transform.position;
                if (fsm.doesLookRight())
                {
                    deltaX = 0.5f;
                }
                else
                {
                    deltaX = -0.5f;
                }
                fsm.unit.transform.position = new Vector3(pos.x + deltaX, pos.y, pos.z);
                fsm.unit.Attack();
            }
            if (fsm.IsAttackEnd)
            {
                switch (fsm.CurPhase)
                {
                case 0:
                    fsm.ChangeState(fsm.chaseState);
                    break;

                case 1:
                    break;

                case 2:
                    break;
                }
            }
        }
示例#3
0
 public override void process(BossSM fsm)
 {
     // about transition
     if (fsm.CheckView())
     {
         fsm.ChangeState(fsm.chaseState);
     }
 }
示例#4
0
 public override void enter(BossSM fsm)
 {
     if (!_isInit)
     {
         Init();
     }
     if (_lastPhase != fsm.CurPhase)
     {
         _lastPhase      = fsm.CurPhase;
         _curAttackOrder = 0;
     }
     _curAttackOrder = _curAttackOrder % _attackList[fsm.CurPhase].Count;
 }
 private void Awake()
 {
     _bossSM = GetComponentInParent <BossSM>();
 }
示例#6
0
 public override void exit(BossSM fsm)
 {
 }
示例#7
0
 public override void process(BossSM fsm)
 {
 }
示例#8
0
 public override void enter(BossSM fsm)
 {
     fsm.anim.ChangeAnim(BossAnim.Die);
     fsm.unit.Idle();
 }
示例#9
0
 public override void enter(BossSM fsm)
 {
     fsm.anim.ChangeAnim(BossAnim.DownPunch);
     fsm.unit.Idle();
     fsm.unit.SetAttackBox(4);
 }
示例#10
0
 public override void enter(BossSM fsm)
 {
     fsm.anim.ChangeAnim(BossAnim.Tornado);
     fsm.unit.Idle();
     fsm.unit.SetAttackBox(3);
 }
示例#11
0
 public override void enter(BossSM fsm)
 {
     fsm.anim.ChangeAnim(BossAnim.Uppercut);
     fsm.unit.Idle();
     fsm.unit.SetAttackBox(2);
 }
示例#12
0
 public override void exit(BossSM fsm)
 {
     fsm.unit.Idle();
     fsm.anim.SetSpeed(1);
     fsm.anim.ChangeAnim(BossAnim.Idle);
 }
示例#13
0
 public abstract void exit(BossSM fsm);
示例#14
0
 public abstract void process(BossSM fsm);
示例#15
0
 public abstract void enter(BossSM fsm);