コード例 #1
0
        public void Attach()
        {
            if (((this.owner != 0) && (this.owner.handle.shape != null)) && ((this.owner.handle.TheActorMeta.ActorType != ActorTypeDef.Invalid) && !this.attached))
            {
                SceneManagement instance = Singleton <SceneManagement> .GetInstance();

                instance.GetCoord(ref this.coord, this.owner.handle.shape);
                instance.AddToTile(this, ref this.coord);
                this.dirty    = false;
                this.attached = true;
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public void Attach()
        {
            if (!this.owner || this.owner.handle.shape == null || this.owner.handle.TheActorMeta.ActorType == ActorTypeDef.Invalid || this.attached)
            {
                return;
            }
            SceneManagement instance = Singleton <SceneManagement> .GetInstance();

            instance.GetCoord(ref this.coord, this.owner.handle.shape);
            instance.AddToTile(this, ref this.coord);
            this.dirty    = false;
            this.attached = true;
        }
コード例 #4
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);
        }
コード例 #5
0
 public void Update()
 {
     if (this.dirty && this.owner && this.owner.handle.shape != null)
     {
         SceneManagement            instance   = Singleton <SceneManagement> .instance;
         SceneManagement.Coordinate coordinate = default(SceneManagement.Coordinate);
         instance.GetCoord(ref coordinate, this.owner.handle.shape);
         if (!this.coord.Equals(ref coordinate))
         {
             instance.RemoveFromTile(this, ref this.coord);
             this.coord = coordinate;
             instance.AddToTile(this, ref this.coord);
         }
         this.dirty = false;
     }
 }
コード例 #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;
     }
 }