private void AddToTile(SceneManagement.Node node, ref SceneManagement.Coordinate coord) { int num = coord.Y * this.TileCountX + coord.X; for (int i = 0; i < coord.NumY; i++) { for (int j = 0; j < coord.NumX; j++) { this.tiles[num + j].nodes.Add(node); } num += this.TileCountX; } }
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 List <PoolObjHandle <ActorRoot> > GetCollidedActorList(Action _action, PoolObjHandle <ActorRoot> InActor, PoolObjHandle <ActorRoot> triggerActor) { VCollisionShape vCollisionShape = null; if (triggerActor) { vCollisionShape = triggerActor.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> .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.handle; if (!this.TargetObjTypeFilter(ref InActor, handle) && !this.TargetCollideTimeFiler(handle) && !this.TargetCollideCountFilter(handle) && !this.TargetMoveDirectionFilter(ref InActor, ref poolObjHandle) && !this.TargetCurrentFilter(ref poolObjHandle)) { this.collidedActors.Add(poolObjHandle); this.type_actorList[(int)handle.TheActorMeta.ActorType].Add(poolObjHandle); } } } } 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)); }
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 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; } }
private void RemoveFromTile(SceneManagement.Node node, ref SceneManagement.Coordinate coord) { if (coord.X == -1 || coord.Y == -1) { return; } int num = coord.Y * this.TileCountX + coord.X; for (int i = 0; i < coord.NumY; i++) { for (int j = 0; j < coord.NumX; j++) { this.tiles[num + j].nodes.Remove(node); } num += this.TileCountX; } }
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)); }
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; } }
private void OnClickBattleScene(CUIEvent uievent) { float num; Ray ray = Camera.main.ScreenPointToRay((Vector3)uievent.m_pointerEventData.position); this._clickPickHeroID = 0; if (this._pickPlane.Raycast(ray, out num)) { Vector3 point = ray.GetPoint(num); SceneManagement instance = Singleton <SceneManagement> .GetInstance(); SceneManagement.Coordinate coord = new SceneManagement.Coordinate(); VInt3 num2 = (VInt3)point; instance.GetCoord_Center(ref coord, num2.xz, 0xbb8); instance.UpdateDirtyNodes(); instance.ForeachActorsBreak(coord, new SceneManagement.Process_Bool(this.TrySearchHero)); if (this._clickPickHeroID > 0) { this.PickHero(this._clickPickHeroID); } } }
private void OnClickBattleScene(CUIEvent uievent) { Ray ray = Camera.main.ScreenPointToRay(uievent.m_pointerEventData.position); this._clickPickHeroID = 0u; float distance; if (this._pickPlane.Raycast(ray, out distance)) { Vector3 point = ray.GetPoint(distance); SceneManagement instance = Singleton <SceneManagement> .GetInstance(); SceneManagement.Coordinate coord = default(SceneManagement.Coordinate); instance.GetCoord_Center(ref coord, ((VInt3)point).get_xz(), 3000); instance.UpdateDirtyNodes(); instance.ForeachActorsBreak(coord, new SceneManagement.Process_Bool(this.TrySearchHero)); if (this._clickPickHeroID > 0u) { this.PickHero(this._clickPickHeroID); } } }
public bool Equals(ref SceneManagement.Coordinate r) { return(this.X == r.X && this.Y == r.Y && this.NumX == r.NumX && this.NumY == r.NumY); }
public bool Equals(ref SceneManagement.Coordinate r) { return((((this.X == r.X) && (this.Y == r.Y)) && (this.NumX == r.NumX)) && (this.NumY == r.NumY)); }