public static VInt3 Move(ActorRoot actor, VInt3 delta, out VInt groundY, out bool collided, MoveDirectionState state = null) { VInt3 result = PathfindingUtility.Move(actor, delta, out groundY, state); collided = (result.x != delta.x || result.z != delta.z); return(result); }
public void UseSkillCacheMove(PoolObjHandle <ActorRoot> _actorRoot, int _deltaTime, int _moveSpeed) { if (!_actorRoot) { return; } if (this.cacheMoveCommand != null && !this.cacheMoveExpire && this.cacheMoveCommand.cmdType == 131) { FrameCommand <MoveDirectionCommand> frameCommand = (FrameCommand <MoveDirectionCommand>) this.cacheMoveCommand; if (!_actorRoot.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Move)) { VInt3 vInt = VInt3.right.RotateY((int)frameCommand.cmdData.Degree).NormalizeTo(_moveSpeed * _deltaTime / 1000); VInt groundY = _actorRoot.handle.groundY; vInt = PathfindingUtility.Move(_actorRoot.handle, vInt, out groundY, out _actorRoot.handle.hasReachedNavEdge, null); if (_actorRoot.handle.MovementComponent.isFlying) { int y = _actorRoot.handle.location.y; _actorRoot.handle.location += vInt; VInt3 location = _actorRoot.handle.location; location.y = y; _actorRoot.handle.location = location; } else { _actorRoot.handle.location += vInt; } _actorRoot.handle.groundY = groundY; } } }
private void ActionMoveLerp(ActorRoot actor, uint nDelta, bool bReset) { if ((actor != null) && !this.stopCondtion) { Vector3 one = Vector3.one; int newMagn = (int)((this.velocity * nDelta) / 0x3e8); one = actor.gameObject.transform.position; if (this.gravity < 0) { VInt num2; this.lerpDirection.y = 0; one += (Vector3)this.lerpDirection.NormalizeTo(newMagn); one.y += ((float)this.gravityControler.GetMotionLerpDistance((int)nDelta)) / 1000f; if (PathfindingUtility.GetGroundY(this.destPosition, out num2) && (one.y < ((float)num2))) { one.y = (float)num2; } } else { one += (Vector3)this.lerpDirection.NormalizeTo(newMagn); } actor.gameObject.transform.position = one; } }
public static Int3 Move(Actor actor, Int3 delta, out Int1 groundY, out bool collided) { Int3 result = PathfindingUtility.Move(actor, delta, out groundY); collided = (result.x != delta.x || result.z != delta.z); return(result); }
public void Teleport() { VInt groundY = this.actor_.get_handle().groundY; VInt3 vInt = this.dir.NormalizeTo(this.moveDistance); VInt3 vInt2 = this.actor_.get_handle().location + vInt; bool flag = false; if (PathfindingUtility.IsValidTarget(this.actor_, vInt2)) { PathfindingUtility.GetGroundY(vInt2, out groundY); vInt2.y = groundY.i; this.actor_.get_handle().location = vInt2; } else { VInt3 vInt3 = PathfindingUtility.FindValidTarget(this.actor_, vInt2, this.actor_.get_handle().location, 10000, out flag); if (flag) { PathfindingUtility.GetGroundY(vInt3, out groundY); vInt3.y = groundY.i; this.actor_.get_handle().location = vInt3; } else { vInt = PathfindingUtility.Move(this.actor_.get_handle(), vInt, out groundY, out this.actor_.get_handle().hasReachedNavEdge, null); this.actor_.get_handle().location += vInt; } } if (this.bUseRecordPosition) { this.actor_.get_handle().ActorControl.RmvNoAbilityFlag(ObjAbilityType.ObjAbility_MoveProtect); } this.actor_.get_handle().groundY = groundY; this.done_ = true; }
private void ActionMoveLerp(ActorRoot actor, uint nDelta, bool bReset) { if (actor == null || this.done_) { return; } int motionLerpDistance = this.motionControler.GetMotionLerpDistance((int)nDelta); VInt3 delta = this.moveDirection * motionLerpDistance / 1000f; Vector3 vector = actor.myTransform.position; VInt vInt2; VInt3 vInt = PathfindingUtility.MoveLerp(actor, (VInt3)vector, delta, out vInt2); if (actor.MovementComponent.isFlying) { float y = vector.y; vector += (Vector3)vInt; Vector3 position = vector; position.y = y; actor.myTransform.position = position; } else { actor.myTransform.position += (Vector3)vInt; } }
public override void Leave(Action _action, Track _track) { base.Leave(_action, _track); if (this.actorObj) { this.RecoverAnimation(); if (this.forbidMove) { this.actorObj.handle.ActorControl.RmvNoAbilityFlag(ObjAbilityType.ObjAbility_Move); } if (this.IsFreeze) { this.actorObj.handle.ActorControl.RmvNoAbilityFlag(ObjAbilityType.ObjAbility_Freeze); } if (this.forbidSkill) { this.actorObj.handle.ActorControl.RmvDisableSkillFlag(SkillSlotType.SLOT_SKILL_COUNT, false); } if (this.freezeHeight > 0 && this.actorObj.handle.isMovable) { VInt vInt = 0; VInt3 location = this.actorObj.handle.location; location.y -= this.freezeHeight; PathfindingUtility.GetGroundY(location, out vInt); if (location.y < vInt.i) { location.y = vInt.i; } this.actorObj.handle.location = location; } } }
public void UseSkillCacheLerpMove(PoolObjHandle <ActorRoot> _actorRoot, int _deltaTime, int _moveSpeed) { if (!_actorRoot) { return; } if (this.cacheMoveCommand != null && !this.cacheMoveExpire && this.cacheMoveCommand.cmdType == 131) { FrameCommand <MoveDirectionCommand> frameCommand = (FrameCommand <MoveDirectionCommand>) this.cacheMoveCommand; if (!_actorRoot.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Move)) { VInt3 vInt = VInt3.right.RotateY((int)frameCommand.cmdData.Degree); Vector3 position = _actorRoot.handle.myTransform.position; VInt3 vInt2 = vInt.NormalizeTo(_moveSpeed * _deltaTime / 1000); VInt vInt3 = 0; vInt2 = PathfindingUtility.MoveLerp(_actorRoot, (VInt3)position, vInt2, out vInt3); if (_actorRoot.handle.MovementComponent.isFlying) { float y = position.y; _actorRoot.handle.myTransform.position += (Vector3)vInt2; Vector3 position2 = _actorRoot.handle.myTransform.position; position2.y = y; _actorRoot.handle.myTransform.position = position2; } else { _actorRoot.handle.myTransform.position += (Vector3)vInt2; } } } }
protected override void OnRevive() { VInt num3; VInt3 zero = VInt3.zero; VInt3 forward = VInt3.forward; if (this.autoRevived && this.m_reviveContext.bBaseRevive) { Singleton <BattleLogic> .GetInstance().mapLogic.GetRevivePosDir(ref base.actor.TheActorMeta, false, out zero, out forward); base.actor.EquipComponent.ResetHasLeftEquipBoughtArea(); } else { Player player = ActorHelper.GetOwnerPlayer(ref this.actorPtr); zero = player.Captain.handle.location; forward = player.Captain.handle.forward; } if (PathfindingUtility.GetGroundY(zero, out num3)) { base.actor.groundY = num3; zero.y = num3.i; } base.actor.forward = forward; base.actor.location = zero; base.actor.ObjLinker.SetForward(forward, -1); base.OnRevive(); Player ownerPlayer = ActorHelper.GetOwnerPlayer(ref this.actorPtr); if (ownerPlayer != null) { Singleton <EventRouter> .instance.BroadCastEvent <Player>(EventID.PlayerReviveTime, ownerPlayer); } }
public void Move(out VInt3 targetDir, int dt) { targetDir = VInt3.forward; if (!this.targetReached && this.canMove) { ActorRoot handle = this.actor.handle; VInt3 location = handle.location; VInt3 num2 = this.CaculateDir(location); if ((this.targetDirection.x != 0) || (this.targetDirection.z != 0)) { targetDir = this.targetDirection; targetDir.NormalizeTo(0x3e8); } else { targetDir = handle.forward; } VInt3 targetPos = handle.location; VInt3 delta = num2; delta *= (this.speed * dt) / 0x3e8; delta = (VInt3)(delta / 1000f); bool flag = (this.rvo != null) && this.rvo.enabled; bool collided = false; if (this.checkNavNode && !flag) { VInt num5; delta = PathfindingUtility.Move((ActorRoot)this.actor, delta, out num5, out collided); handle.groundY = num5; } VInt3 num7 = handle.location - this.targetPos; if (num7.sqrMagnitudeLong2D <= delta.sqrMagnitudeLong2D) { if (this.checkNavNode && !this.targetPosIsValid) { targetPos = handle.location + delta; } else { targetPos = this.targetPos; } this.targetReached = true; this.OnTargetReached(); } else { targetPos = handle.location + delta; } if (flag) { VInt3 a = targetPos - handle.location; a = IntMath.Divide(a, 0x3e8L, (long)dt); this.rvo.Move(a); } else { handle.location = targetPos; handle.hasReachedNavEdge = collided; } } }
public void UseSkillCacheMove(PoolObjHandle <ActorRoot> _actorRoot, int _deltaTime, int _moveSpeed) { if ((_actorRoot != 0) && (((this.cacheMoveCommand != null) && !this.cacheMoveExpire) && (this.cacheMoveCommand.cmdType == 2))) { FrameCommand <MoveDirectionCommand> cacheMoveCommand = (FrameCommand <MoveDirectionCommand>) this.cacheMoveCommand; if (!_actorRoot.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Move)) { VInt3 delta = VInt3.right.RotateY(cacheMoveCommand.cmdData.Degree).NormalizeTo((_moveSpeed * _deltaTime) / 0x3e8); VInt groundY = _actorRoot.handle.groundY; delta = PathfindingUtility.Move(_actorRoot.handle, delta, out groundY, out _actorRoot.handle.hasReachedNavEdge, null); if (_actorRoot.handle.MovementComponent.isFlying) { int y = _actorRoot.handle.location.y; ActorRoot handle = _actorRoot.handle; handle.location += delta; VInt3 location = _actorRoot.handle.location; location.y = y; _actorRoot.handle.location = location; } else { ActorRoot local2 = _actorRoot.handle; local2.location += delta; } _actorRoot.handle.groundY = groundY; } } }
private void ActionMoveLerp(ActorRoot actor, uint nDelta, bool bReset) { if ((actor != null) && !this.stopCondtion) { VInt3 location = actor.location; VInt3 num2 = this.destPosition - location; int newMagn = (int)((this.velocity * nDelta) / 0x3e8); Vector3 position = actor.gameObject.transform.position; if (this.gravity < 0) { VInt num4; num2.y = 0; position += (Vector3)num2.NormalizeTo(newMagn); position.y += ((float)this.gravityControler.GetMotionLerpDistance((int)nDelta)) / 1000f; if (PathfindingUtility.GetGroundY((VInt3)position, out num4) && (position.y < ((float)num4))) { position.y = (float)num4; } } else { position += (Vector3)num2.NormalizeTo(newMagn); } actor.gameObject.transform.position = position; } }
public void UseSkillCacheLerpMove(PoolObjHandle <ActorRoot> _actorRoot, int _deltaTime, int _moveSpeed) { if ((_actorRoot != 0) && (((this.cacheMoveCommand != null) && !this.cacheMoveExpire) && (this.cacheMoveCommand.cmdType == 2))) { FrameCommand <MoveDirectionCommand> cacheMoveCommand = (FrameCommand <MoveDirectionCommand>) this.cacheMoveCommand; if (!_actorRoot.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Move)) { VInt3 num = VInt3.right.RotateY(cacheMoveCommand.cmdData.Degree); Vector3 position = _actorRoot.handle.gameObject.transform.position; VInt3 delta = num.NormalizeTo((_moveSpeed * _deltaTime) / 0x3e8); VInt groundY = 0; delta = PathfindingUtility.MoveLerp((ActorRoot)_actorRoot, (VInt3)position, delta, out groundY); if (_actorRoot.handle.MovementComponent.isFlying) { float y = position.y; Transform transform = _actorRoot.handle.gameObject.transform; transform.position += (Vector3)delta; Vector3 vector2 = _actorRoot.handle.gameObject.transform.position; vector2.y = y; _actorRoot.handle.gameObject.transform.position = vector2; } else { Transform transform2 = _actorRoot.handle.gameObject.transform; transform2.position += (Vector3)delta; } } } }
public void GravityMoveLerp(int _deltaTime, bool bReset) { int motionLerpDistance = 0; Vector3 zero = Vector3.zero; SpecialMotionControler controler = null; if (this.Movement != null) { VInt num2; if (this.motionControlers.Count != 0) { this.Movement.isLerpFlying = true; zero = this.Movement.actor.gameObject.transform.position; PathfindingUtility.GetGroundY((VInt3)zero, out num2); for (int i = 0; i < this.motionControlers.Count; i++) { controler = this.motionControlers[i]; motionLerpDistance += controler.GetMotionLerpDistance(_deltaTime); } zero.y += ((float)motionLerpDistance) / 1000f; if (((float)num2) > zero.y) { zero.y = (float)num2; this.Movement.actor.gameObject.transform.position = zero; } else { this.Movement.actor.gameObject.transform.position = zero; } } else if (this.Movement.isLerpFlying) { zero = this.Movement.actor.gameObject.transform.position; PathfindingUtility.GetGroundY((VInt3)zero, out num2); if (((float)num2) >= zero.y) { zero.y = (float)num2; this.Movement.actor.gameObject.transform.position = zero; this.Movement.isLerpFlying = false; this.gravityControler.ResetLerpTime(); } else { motionLerpDistance = this.gravityControler.GetMotionLerpDistance(_deltaTime); zero.y += ((float)motionLerpDistance) / 1000f; if (((float)num2) > zero.y) { zero.y = (float)num2; this.Movement.actor.gameObject.transform.position = zero; this.Movement.isLerpFlying = false; this.gravityControler.ResetLerpTime(); } else { this.Movement.actor.gameObject.transform.position = zero; } } } } }
public override void Enter(Action _action, Track _track) { base.Enter(_action, _track); this.actorObj = _action.GetActorHandle(this.targetId); if (!this.actorObj) { return; } ObjWrapper actorControl = this.actorObj.get_handle().ActorControl; if (actorControl == null) { return; } this.PauseAnimation(); actorControl.TerminateMove(); actorControl.ClearMoveCommand(); actorControl.ForceAbortCurUseSkill(); this.actorObj.get_handle().ActorControl.AddNoAbilityFlag(ObjAbilityType.ObjAbility_Move); this.actorObj.get_handle().ActorControl.AddNoAbilityFlag(ObjAbilityType.ObjAbility_Freeze); this.actorObj.get_handle().ActorControl.AddDisableSkillFlag(SkillSlotType.SLOT_SKILL_COUNT, false); if (this.freezeHeight > 0 && this.actorObj.get_handle().isMovable) { VInt vInt = 0; VInt3 location = this.actorObj.get_handle().location; PathfindingUtility.GetGroundY(location, out vInt); location.y = vInt.i + this.freezeHeight; this.actorObj.get_handle().location = location; } }
public override void Leave(Action _action, Track _track) { if (this.actor_ != 0) { if (this.IgnoreCollision) { bool flag = false; _action.refParams.GetRefParam("_HitTargetHero", ref flag); if (!flag) { this.SetFinalPos(); } else { VInt3 zero = VInt3.zero; _action.refParams.GetRefParam("_HitTargetHeroPos", ref zero); if (!PathfindingUtility.IsValidTarget((ActorRoot)this.actor_, zero)) { this.SetFinalPos(); } else { this.actor_.handle.location = zero; } } } this.actor_.handle.ObjLinker.RmvCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); this.actor_.handle.ActorControl.RmvNoAbilityFlag(ObjAbilityType.ObjAbility_Move); this.done_ = true; } }
public bool FindNearestNotBrickFromWorldLocNonFow(ref VInt3 newPos, ActorRoot ar) { VInt3 vInt = new VInt3(newPos.x, newPos.z, 0); VInt2 vInt2 = VInt2.zero; this.LevelGrid.WorldPosToGrid(vInt, out vInt2.x, out vInt2.y); bool flag = false; FieldObj.SViewBlockAttr sViewBlockAttr = default(FieldObj.SViewBlockAttr); if (this.QueryAttr(vInt2, out sViewBlockAttr) && sViewBlockAttr.BlockType == 2) { flag = true; } else if (!PathfindingUtility.IsValidTarget(ar, newPos)) { flag = true; } if (!flag) { return(true); } VInt2 zero = VInt2.zero; if (this.FindNearestGrid(vInt2, vInt, FieldObj.EViewBlockType.Brick, true, 4, ar, out zero)) { vInt2 = zero; VInt3 zero2 = VInt3.zero; this.LevelGrid.GridToWorldPos(vInt2.x, vInt2.y, out zero2); newPos = new VInt3(zero2.x, newPos.y, zero2.y); return(true); } return(false); }
private void SetFinalPos() { if (!this.bStayInCurrentPosWhenStop) { VInt vInt = 0; PathfindingUtility.GetGroundY(this.finalPos, out vInt); this.finalPos.y = vInt.i; this.actor_.handle.location = this.finalPos; } else if (!PathfindingUtility.IsValidTarget(this.actor_, this.actor_.handle.location)) { bool flag = false; VInt3 vInt2 = VInt3.zero; vInt2 = PathfindingUtility.FindValidTarget(this.actor_, this.actor_.handle.location, this.finalPos, 10000, out flag); if (!flag) { vInt2 = PathfindingUtility.FindValidTarget(this.actor_, this.actor_.handle.location, this.srcPos, 10000, out flag); } if (flag) { VInt vInt3 = 0; PathfindingUtility.GetGroundY(vInt2, out vInt3); vInt2.y = vInt3.i; this.finalPos = vInt2; this.actor_.handle.location = vInt2; } else { this.actor_.handle.location = this.finalPos; } } }
private void ActionMoveLerp(ActorRoot actor, uint nDelta, bool bReset) { if (actor != null) { if (this.done_ || this.teleport) { actor.gameObject.transform.position = (Vector3)actor.location; } else { VInt groundY = 0; VInt3 delta = this.dir.NormalizeTo((int)((this.moveSpeed * nDelta) / 0x3e8)); Vector3 position = actor.gameObject.transform.position; if (!this.IgnoreCollision) { delta = PathfindingUtility.MoveLerp(actor, (VInt3)position, delta, out groundY); } if (actor.MovementComponent.isFlying) { float y = position.y; Transform transform = actor.gameObject.transform; transform.position += (Vector3)delta; Vector3 vector2 = actor.gameObject.transform.position; vector2.y = y; actor.gameObject.transform.position = vector2; } else { Transform transform2 = actor.gameObject.transform; transform2.position += (Vector3)delta; } } } }
private void ActionMoveLerp(ActorRoot actor, uint nDelta, bool bReset) { if (actor == null || this.stopCondtion) { return; } VInt3 location = actor.location; VInt3 vInt = this.destPosition - location; int num = this.velocity * (int)nDelta / 1000; Vector3 vector = actor.myTransform.position; if (this.gravity < 0) { vInt.y = 0; vector += (Vector3)vInt.NormalizeTo(num); vector.y += (float)this.gravityControler.GetMotionLerpDistance((int)nDelta) / 1000f; VInt vInt2; if (PathfindingUtility.GetGroundY((VInt3)vector, out vInt2) && vector.y < (float)vInt2) { vector.y = (float)vInt2; } } else { vector += (Vector3)vInt.NormalizeTo(num); } actor.myTransform.position = vector; }
public bool FindNearestGrid(VInt2 inCenterCell, VInt3 inCenterPosWorld, FieldObj.EViewBlockType inBlockType, bool bNonType, int inThicknessMax, ActorRoot ar, out VInt2 result) { result = VInt2.zero; FieldObj.SViewBlockAttr sViewBlockAttr = default(FieldObj.SViewBlockAttr); bool flag = false; int num = 1; List <VInt2> list = new List <VInt2>(); List <VInt2> list2 = new List <VInt2>(); while (!flag && num <= inThicknessMax) { list2.Clear(); this.CollectNeighbourGrids(list2, list, inCenterCell, num); num++; list.AddRange(list2); if (list2.get_Count() > 0) { for (int i = list2.get_Count() - 1; i >= 0; i--) { this.QueryAttr(list2.get_Item(i), out sViewBlockAttr); if ((bNonType && sViewBlockAttr.BlockType == (byte)inBlockType) || (!bNonType && sViewBlockAttr.BlockType != (byte)inBlockType)) { list2.RemoveAt(i); } } } if (list2.get_Count() > 0) { long num2 = 2147483647L; for (int j = 0; j < list2.get_Count(); j++) { VInt2 vInt = list2.get_Item(j); VInt3 zero = VInt3.zero; this.LevelGrid.GridToWorldPos(vInt.x, vInt.y, out zero); long sqrMagnitudeLong = (inCenterPosWorld - zero).sqrMagnitudeLong; if (sqrMagnitudeLong < num2) { if (ar == null) { flag = true; num2 = sqrMagnitudeLong; result = list2.get_Item(j); } else { VInt3 target = new VInt3(zero.x, 0, zero.y); if (PathfindingUtility.IsValidTarget(ar, target)) { flag = true; num2 = sqrMagnitudeLong; result = list2.get_Item(j); } } } } } } return(flag); }
public void ProcessInner(Action _action, Track _track, int delta) { VInt3 location = this.moveActor.handle.location; if ((this.MoveType == ActorMoveType.Target) && (this.tarActor != 0)) { this.destPosition = this.tarActor.handle.location; if ((this.tarActor != 0) && (this.tarActor.handle.CharInfo != null)) { CActorInfo charInfo = this.tarActor.handle.CharInfo; this.hitHeight = charInfo.iBulletHeight; VInt3 a = this.moveActor.handle.location - this.destPosition; a.y = 0; a = a.NormalizeTo(0x3e8); this.destPosition += IntMath.Divide(a, (long)charInfo.iCollisionSize.x, 0x3e8L); } this.destPosition.y += this.hitHeight; } this.moveDirection = this.destPosition - location; this.lerpDirection = this.moveDirection; if (this.bMoveRotate) { this.RotateMoveBullet(this.moveDirection); } int newMagn = (this.velocity * delta) / 0x3e8; if ((newMagn * newMagn) >= this.moveDirection.sqrMagnitudeLong2D) { this.moveActor.handle.location = this.destPosition; this.stopCondtion = true; } else { VInt3 num4; if (this.gravity < 0) { VInt num5; this.moveDirection.y = 0; num4 = location + this.moveDirection.NormalizeTo(newMagn); num4.y += this.gravityControler.GetMotionDeltaDistance(delta); if (PathfindingUtility.GetGroundY(this.destPosition, out num5) && (num4.y < num5.i)) { num4.y = num5.i; } } else { num4 = location + this.moveDirection.NormalizeTo(newMagn); } this.moveActor.handle.location = num4; } SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext"); if (refParamObject != null) { refParamObject.EffectPos = this.moveActor.handle.location; refParamObject.EffectDir = this.moveDirection; } }
private void SetFinalPos() { VInt vInt = 0; PathfindingUtility.GetGroundY(this.finalPos, out vInt); this.finalPos.y = vInt.i; this.actor_.get_handle().location = this.finalPos; }
public override void Move(VInt3 delta) { ActorRoot actor = this.Movement.actor; VInt groundY; actor.location += PathfindingUtility.Move(actor, delta, out groundY, out actor.hasReachedNavEdge, this.Movement.MoveDirState); actor.groundY = groundY; }
public override void Move(VInt3 delta) { VInt num; ActorRoot actor = base.Movement.actor; actor.location += PathfindingUtility.Move(actor, delta, out num, out actor.hasReachedNavEdge, base.Movement.MoveDirState); actor.groundY = num; }
private void SetFinalPos() { VInt groundY = 0; PathfindingUtility.GetGroundY(this.finalPos, out groundY); this.finalPos.y = groundY.i; this.actor_.handle.location = this.finalPos; }
public static Int3 Move(Actor actor, Int3 delta, out Int1 groundY) { //if (actor.isMovable) { groundY = actor.Position.y; Int3 location = actor.Position; return(PathfindingUtility.InternalMove(location, delta, ref groundY, actor)); } //groundY = actor.groundY; return(Int3.zero); }
public static VInt3 MoveLerp(ActorRoot actor, VInt3 srcPos, VInt3 delta, out VInt groundY) { if (actor.isMovable) { groundY = ((actor != null) ? actor.groundY : 0); VInt3 zero = VInt3.zero; return(PathfindingUtility.InternalMove(srcPos, delta, ref groundY, actor, null)); } groundY = actor.groundY; return(VInt3.zero); }
public static VInt3 Move(ActorRoot actor, VInt3 delta, out VInt groundY, MoveDirectionState state = null) { if (actor.isMovable) { groundY = ((actor != null) ? actor.groundY : 0); VInt3 location = actor.location; return(PathfindingUtility.InternalMove(location, delta, ref groundY, actor, state)); } groundY = actor.groundY; return(VInt3.zero); }
public override void Process(Action _action, Track _track, int _localTime) { if (!this.done_ && (this.actor_ != 0)) { bool flag = this.lastTime_ < this.rotationTime; int moveTick = _localTime - this.lastTime_; this.lastTime_ = _localTime; if (this.teleport) { this.Teleport(); } else { if (flag) { float t = Mathf.Min(1f, (float)(_localTime / this.rotationTime)); Quaternion quaternion = Quaternion.Slerp(this.fromRot, this.toRot, t); this.actor_.handle.rotation = quaternion; } if ((this.moveTick - moveTick) <= 0) { moveTick = this.moveTick; this.done_ = true; } else { this.moveTick -= moveTick; } VInt3 delta = this.dir.NormalizeTo((this.moveSpeed * moveTick) / 0x3e8); VInt groundY = this.actor_.handle.groundY; if (!this.IgnoreCollision) { delta = PathfindingUtility.Move(this.actor_.handle, delta, out groundY, out this.actor_.handle.hasReachedNavEdge); } if (this.actor_.handle.MovementComponent.isFlying) { int y = this.actor_.handle.location.y; ActorRoot handle = this.actor_.handle; handle.location += delta; VInt3 location = this.actor_.handle.location; location.y = y; this.actor_.handle.location = location; } else { ActorRoot local2 = this.actor_.handle; local2.location += delta; } this.actor_.handle.groundY = groundY; base.Process(_action, _track, _localTime); } } }