1
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user