private List <PoolObjHandle <ActorRoot> > FilterTargetByTriggerRegion(Action _action, PoolObjHandle <ActorRoot> _attackActor, BaseSkill _skill)
        {
            if (!_attackActor || _skill == null)
            {
                return(null);
            }
            HitTriggerTick.targetActors.Clear();
            if (this.bFindTargetByRotateBodyBullet)
            {
                PoolObjHandle <ActorRoot> poolObjHandle = default(PoolObjHandle <ActorRoot>);
                _action.refParams.GetRefParam("FindEnemyActor", ref poolObjHandle);
                if (poolObjHandle)
                {
                    HitTriggerTick.targetActors.Add(poolObjHandle);
                }
                return(HitTriggerTick.targetActors);
            }
            PoolObjHandle <ActorRoot> targetActor = _skill.GetTargetActor();

            if (targetActor && !targetActor.handle.ActorControl.IsDeadState)
            {
                HitTriggerTick.targetActors.Add(targetActor);
            }
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.triggerId);

            if (!actorHandle)
            {
                return(HitTriggerTick.targetActors);
            }
            this.shape = AGE_Helper.GetCollisionShape(actorHandle);
            if (this.shape != null)
            {
                Singleton <TargetSearcher> .instance.BeginCollidedActorList(_attackActor, this.shape, false, true, null, this.bCheckSight);

                List <PoolObjHandle <ActorRoot> > collidedActors = Singleton <TargetSearcher> .instance.GetCollidedActors();

                if (collidedActors != null && collidedActors.get_Count() > 0)
                {
                    List <PoolObjHandle <ActorRoot> > .Enumerator enumerator = collidedActors.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        if (HitTriggerTick.targetActors.IndexOf(enumerator.get_Current()) == -1)
                        {
                            HitTriggerTick.targetActors.Add(enumerator.get_Current());
                        }
                    }
                }
                Singleton <TargetSearcher> .instance.EndCollidedActorList();
            }
            return(HitTriggerTick.targetActors);
        }
Esempio n. 2
0
        private List <PoolObjHandle <ActorRoot> > FilterTargetByTriggerRegion(Action _action, PoolObjHandle <ActorRoot> _attackActor, BaseSkill _skill)
        {
            if ((_attackActor == 0) || (_skill == null))
            {
                return(null);
            }
            List <PoolObjHandle <ActorRoot> > list        = null;
            PoolObjHandle <ActorRoot>         targetActor = _skill.GetTargetActor();

            if ((targetActor != 0) && !targetActor.handle.ActorControl.IsDeadState)
            {
                if (list == null)
                {
                    list = new List <PoolObjHandle <ActorRoot> >();
                }
                list.Add(targetActor);
            }
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.triggerId);

            if (actorHandle != 0)
            {
                this.shape = AGE_Helper.GetCollisionShape((ActorRoot)actorHandle);
                if (this.shape == null)
                {
                    return(list);
                }
                Singleton <TargetSearcher> .instance.BeginCollidedActorList(_attackActor, this.shape, false, true, null);

                List <PoolObjHandle <ActorRoot> > collidedActors = Singleton <TargetSearcher> .instance.GetCollidedActors();

                if ((collidedActors != null) && (collidedActors.Count > 0))
                {
                    if (list == null)
                    {
                        list = new List <PoolObjHandle <ActorRoot> >();
                    }
                    List <PoolObjHandle <ActorRoot> > .Enumerator enumerator = collidedActors.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        if (list.IndexOf(enumerator.Current) == -1)
                        {
                            list.Add(enumerator.Current);
                        }
                    }
                }
                Singleton <TargetSearcher> .instance.EndCollidedActorList();
            }
            return(list);
        }