Пример #1
0
    public bool ChangeTarget()
    {
        m_minRot = float.MaxValue;
        Actor lastActor = TargetManager.CurrentTarget;

        TargetManager.CurrentTarget = null;
        ActorManager.Singleton.ForEach(CheckTarget);
        if (TargetManager.CurrentTarget == null)
        {
            TargetManager.ClearTargetListValue(lastActor);
            m_minRot = float.MaxValue;
            ActorManager.Singleton.ForEach(CheckTarget);
            if (TargetManager.CurrentTarget == null)
            {
                return(false);
            }
        }
        TargetManager.ModifyTargetListValue(1, TargetManager.CurrentTarget);
        if (lastActor != TargetManager.CurrentTarget)
        {
            AttackAction action = this.ActionControl.LookupAction(ActorAction.ENType.enAttackAction) as AttackAction;
            if (action != null && action.IsNormalAttack())
            {//普攻,移除AttackAction
                this.ActionControl.RemoveAction(ActorAction.ENType.enAttackAction);
            }
        }
        else
        {
            if (TargetManager.TargetList.Count > 1)
            {
                ChangeTarget();
            }
        }
        FireNormalSkill();
        return(true);
    }