public List <PoolObjHandle <ActorRoot> > GetCollidedActorList(Action _action, PoolObjHandle <ActorRoot> InActor, PoolObjHandle <ActorRoot> triggerActor)
        {
            VCollisionShape vCollisionShape = null;

            if (triggerActor)
            {
                vCollisionShape = triggerActor.get_handle().shape;
            }
            this.triggerHeroList.Clear();
            this.triggerMonsterList.Clear();
            this.triggerOrganList.Clear();
            this.triggerEyeList.Clear();
            this.triggerPriority.Clear();
            this.collidedActors.Clear();
            if (vCollisionShape == null && this.bUseTriggerObj)
            {
                return(null);
            }
            if (this.bUseTriggerObj)
            {
                this._coordInActor = InActor;
                this._coordShape   = vCollisionShape;
                SceneManagement instance = Singleton <SceneManagement> .GetInstance();

                SceneManagement.Coordinate coord = default(SceneManagement.Coordinate);
                instance.GetCoord(ref coord, vCollisionShape);
                instance.UpdateDirtyNodes();
                instance.ForeachActors(coord, this._coordHandler);
                this._coordInActor.Release();
                this._coordShape = null;
            }
            else
            {
                List <PoolObjHandle <ActorRoot> > gameActors = Singleton <GameObjMgr> .get_instance().GameActors;

                int count = gameActors.get_Count();
                for (int i = 0; i < count; i++)
                {
                    PoolObjHandle <ActorRoot> poolObjHandle = gameActors.get_Item(i);
                    if (poolObjHandle)
                    {
                        ActorRoot handle = poolObjHandle.get_handle();
                        if (!this.TargetObjTypeFilter(ref InActor, handle) && !this.TargetCollideTimeFiler(handle) && !this.TargetCollideCountFilter(handle) && !this.TargetMoveDirectionFilter(ref InActor, ref poolObjHandle))
                        {
                            this.collidedActors.Add(poolObjHandle);
                            this.type_actorList[(int)handle.TheActorMeta.ActorType].Add(poolObjHandle);
                        }
                    }
                }
            }
            return(this.collidedActors);
        }
Exemplo n.º 2
0
        public List <PoolObjHandle <ActorRoot> > GetCollidedActorList(AGE.Action _action, PoolObjHandle <ActorRoot> InActor, PoolObjHandle <ActorRoot> triggerActor)
        {
            VCollisionShape shape = null;

            if (triggerActor != 0)
            {
                shape = triggerActor.handle.shape;
            }
            this.triggerHeroList.Clear();
            this.triggerMonsterList.Clear();
            this.triggerOrganList.Clear();
            this.triggerEyeList.Clear();
            this.triggerPriority.Clear();
            this.collidedActors.Clear();
            if ((shape == null) && this.bUseTriggerObj)
            {
                return(null);
            }
            if (this.bUseTriggerObj)
            {
                this._coordInActor = InActor;
                this._coordShape   = shape;
                SceneManagement instance = Singleton <SceneManagement> .GetInstance();

                SceneManagement.Coordinate coord = new SceneManagement.Coordinate();
                instance.GetCoord(ref coord, shape);
                instance.UpdateDirtyNodes();
                instance.ForeachActors(coord, this._coordHandler);
                this._coordInActor.Release();
                this._coordShape = null;
            }
            else
            {
                List <PoolObjHandle <ActorRoot> > gameActors = Singleton <GameObjMgr> .instance.GameActors;
                int count = gameActors.Count;
                for (int i = 0; i < count; i++)
                {
                    PoolObjHandle <ActorRoot> item = gameActors[i];
                    if (item != 0)
                    {
                        ActorRoot handle = item.handle;
                        if ((!this.TargetObjTypeFilter(ref InActor, handle) && !this.TargetCollideTimeFiler(handle)) && !this.TargetCollideCountFilter(handle))
                        {
                            this.collidedActors.Add(item);
                            this.type_actorList[(int)handle.TheActorMeta.ActorType].Add(item);
                        }
                    }
                }
            }
            return(this.collidedActors);
        }
        public uint SearchNearestTarget(ref PoolObjHandle <ActorRoot> _actorPtr, VInt3 _position, int _srchR)
        {
            this.Clear();
            this.curActorPtr    = _actorPtr;
            this.searchRadius   = _srchR;
            this.searchPosition = _position;
            this.NearestHandler = new SceneManagement.Process(this.FilterNearestActorByPosition);
            SceneManagement instance = Singleton <SceneManagement> .GetInstance();

            SceneManagement.Coordinate coord = default(SceneManagement.Coordinate);
            instance.GetCoord_Center(ref coord, _position.xz, _srchR);
            instance.UpdateDirtyNodes();
            instance.ForeachActors(coord, this.NearestHandler);
            return(this.GetSearchPriorityTarget(true));
        }
Exemplo n.º 4
0
        public uint SearchNearestTarget(ref PoolObjHandle <ActorRoot> _actorPtr, int _srchR, uint _typeMask)
        {
            this.Clear();
            this.curActorPtr    = _actorPtr;
            this.searchRadius   = _srchR;
            this.searchTypeMask = _typeMask;
            this.NearestHandler = new SceneManagement.Process(this.FilterNearestActor);
            SceneManagement instance = Singleton <SceneManagement> .GetInstance();

            SceneManagement.Coordinate coord = new SceneManagement.Coordinate();
            instance.GetCoord_Center(ref coord, _actorPtr.handle.location.xz, _srchR);
            instance.UpdateDirtyNodes();
            instance.ForeachActors(coord, this.NearestHandler);
            return(this.GetSearchPriorityTarget());
        }
        public uint SearchNearestTarget(ref PoolObjHandle <ActorRoot> _actorPtr, int _srchR, uint _typeMask, bool bIncludeMonsterNotInBattle = true, SearchTargetPriority priority = SearchTargetPriority.CommonAttack)
        {
            this.Clear();
            this.curActorPtr    = _actorPtr;
            this.searchRadius   = _srchR;
            this.searchTypeMask = _typeMask;
            this.NearestHandler = new SceneManagement.Process(this.FilterNearestActor);
            SceneManagement instance = Singleton <SceneManagement> .GetInstance();

            SceneManagement.Coordinate coord = default(SceneManagement.Coordinate);
            instance.GetCoord_Center(ref coord, _actorPtr.get_handle().location.get_xz(), _srchR);
            instance.UpdateDirtyNodes();
            instance.ForeachActors(coord, this.NearestHandler);
            if (priority == SearchTargetPriority.CommonAttack)
            {
                return(this.GetSearchPriorityTarget(bIncludeMonsterNotInBattle));
            }
            return(this.GetSearchPriorityTargetInLastHitMode(bIncludeMonsterNotInBattle));
        }
Exemplo n.º 6
0
 public void BeginCollidedActorList(PoolObjHandle<ActorRoot> InActor, VCollisionShape collisionShape, bool bFilterEnemy, bool bFilterAlly, AreaEventTrigger InTriggerRef)
 {
     this.collidedActors.Clear();
     if (collisionShape != null)
     {
         this._coordActor = InActor;
         this._coordShape = collisionShape;
         this._coordFilterEnemy = bFilterEnemy;
         this._coordFilterAlly = bFilterAlly;
         this._coordTriggerRef = InTriggerRef;
         SceneManagement instance = Singleton<SceneManagement>.GetInstance();
         SceneManagement.Coordinate coord = new SceneManagement.Coordinate();
         instance.GetCoord(ref coord, collisionShape);
         instance.UpdateDirtyNodes();
         instance.ForeachActors(coord, this._coordHandler);
         this._coordShape = null;
         this._coordTriggerRef = null;
     }
 }