This commit is contained in:
CortexCore
2023-10-02 23:24:56 +08:00
parent 8ef5c7ec0a
commit 947e52e748
183 changed files with 107857 additions and 9378 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using BITFALL.Player.Equip;
using BITKit;
using BITKit.Entities;
using UnityEngine;
@@ -18,15 +19,23 @@ namespace BITFALL.Player.Movement
private Quaternion currentRotation;
private Vector3 currentPosition;
private IEntityMovement _movement;
private IEquipService _equipService;
public override void OnAwake()
{
_movement = entity.Get<IEntityMovement>();
_equipService = entity.Get<IEquipService>();
}
public override void OnLateUpdate(float deltaTime)
{
var velocity = _movement.LocomotionBasedVelocity;
var angularVelocity = _movement.AngularVelocity;
if (_equipService.Zoom.Allow)
{
velocity = default;
angularVelocity = default;
}
currentPosition = Vector3.Lerp(currentPosition,velocity * posValue,posDelta * deltaTime);
currentRotation = Quaternion.Lerp(currentRotation,Quaternion.Euler(angularVelocity * rotValue),rotDelta * deltaTime);