示例#1
0
 public override void Visit(SkillState skillState)
 {
     if (skillState.IsEnd())
     {
         BasicState basicState = player.GetBasicState();
         basicState.ChaseTarget(targetUnit);
         player.SetState(basicState);
     }
 }
示例#2
0
 public override void Visit(BasicState basicState)
 {
     if (baseAttackStrategy.GetRange() < player.DistanceToUnit(targetUnit))
     {
         basicState.ChaseTarget(targetUnit);
     }
     else
     {
         basicState.AttackTarget(targetUnit);
     }
 }
    public override void Visit(BasicState basicState)
    {
        if (false == basicState.IsTargetIngState())
        {
            BasicState idleState = player.GetBasicState();
            idleState.Stop();
            player.SetState(idleState);
        }

        Unit targetUnit = basicState.GetTargetUnit();

        if (range > player.DistanceToUnit(targetUnit))
        {
            SkillState skillState = skill.GetSkillState();
            skillState.SetTargetUnit(targetUnit);
            basicState.ChageToSkillState(skill.GetSkillState());
        }
        else
        {
            basicState.ChaseTarget(targetUnit);
        }
    }