Beispiel #1
0
        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 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;
             }
         }
     }
 }
 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;
             }
         }
     }
 }
Beispiel #4
0
 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;
             }
         }
     }
 }
Beispiel #5
0
 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
         {
             VInt3 num3;
             VInt  groundY = 0;
             VInt3 dir     = this.dir;
             if (!this.shouldUseAcceleration)
             {
                 num3 = dir.NormalizeTo((int)((this.moveSpeed * nDelta) / 0x3e8));
             }
             else
             {
                 long num4 = (this.lastLerpMoveSpeed * nDelta) + ((long)((((this.acceleration * nDelta) * nDelta) / ((ulong)2L)) / ((ulong)0x3e8L)));
                 num4 /= 0x3e8L;
                 num3  = dir.NormalizeTo((int)num4);
                 this.lastLerpMoveSpeed += ((int)(this.acceleration * nDelta)) / 0x3e8;
             }
             Vector3 position = actor.gameObject.transform.position;
             if (!this.IgnoreCollision)
             {
                 num3 = PathfindingUtility.MoveLerp(actor, (VInt3)position, num3, out groundY);
             }
             if (actor.MovementComponent.isFlying)
             {
                 float     y         = position.y;
                 Transform transform = actor.gameObject.transform;
                 transform.position += (Vector3)num3;
                 Vector3 vector2 = actor.gameObject.transform.position;
                 vector2.y = y;
                 actor.gameObject.transform.position = vector2;
             }
             else
             {
                 Transform transform2 = actor.gameObject.transform;
                 transform2.position += (Vector3)num3;
             }
         }
     }
 }
Beispiel #6
0
 private void ActionMoveLerp(ActorRoot actor, uint nDelta, bool bReset)
 {
     if (actor == null)
     {
         return;
     }
     if (this.done_ || this.teleport)
     {
         actor.myTransform.position = (Vector3)actor.location;
     }
     else
     {
         VInt  vInt  = 0;
         VInt3 vInt2 = this.dir;
         VInt3 vInt3;
         if (!this.shouldUseAcceleration)
         {
             vInt3 = vInt2.NormalizeTo(this.moveSpeed * (int)nDelta / 1000);
         }
         else
         {
             long num = (long)this.lastLerpMoveSpeed * (long)((ulong)nDelta) + (long)this.acceleration * (long)((ulong)nDelta) * (long)((ulong)nDelta) / 2L / 1000L;
             num  /= 1000L;
             vInt3 = vInt2.NormalizeTo((int)num);
             this.lastLerpMoveSpeed += (int)((long)this.acceleration * (long)((ulong)nDelta)) / 1000;
         }
         Vector3 position = actor.myTransform.position;
         if (!this.IgnoreCollision)
         {
             vInt3 = PathfindingUtility.MoveLerp(actor, (VInt3)position, vInt3, out vInt);
         }
         if (actor.MovementComponent.isFlying)
         {
             float y = position.y;
             actor.myTransform.position += (Vector3)vInt3;
             Vector3 position2 = actor.myTransform.position;
             position2.y = y;
             actor.myTransform.position = position2;
         }
         else
         {
             actor.myTransform.position += (Vector3)vInt3;
         }
     }
 }
 private void ActionMoveLerp(ActorRoot actor, uint nDelta, bool bReset)
 {
     if ((actor != null) && !this.done_)
     {
         VInt    num2;
         int     motionLerpDistance = this.motionControler.GetMotionLerpDistance((int)nDelta);
         VInt3   delta    = (VInt3)((this.moveDirection * motionLerpDistance) / 1000f);
         Vector3 position = actor.gameObject.transform.position;
         VInt3   num4     = PathfindingUtility.MoveLerp(actor, (VInt3)position, delta, out num2);
         if (actor.MovementComponent.isFlying)
         {
             float y = position.y;
             position += (Vector3)num4;
             Vector3 vector2 = position;
             vector2.y = y;
             actor.gameObject.transform.position = vector2;
         }
         else
         {
             Transform transform = actor.gameObject.transform;
             transform.position += (Vector3)num4;
         }
     }
 }