This commit is contained in:
CortexCore
2023-12-17 02:03:13 +08:00
parent 961ae8feb4
commit 11a8104c75
6 changed files with 79 additions and 56 deletions

View File

@@ -233,6 +233,7 @@ namespace BITKit.Entities
{
public IOptional<float> Zoom { get; } = new Optional<float>(){Value = 1};
public float Stable { get; set; }
public float Aim { get; set; }
public bool AllowAttack { get; set; }
public bool AllowScope { get; set; }
@@ -331,14 +332,14 @@ namespace BITKit.Entities
if (virtualCamera is not null)
{
virtualCamera.m_Lens.FieldOfView =
var targetFov =
Mathf.Lerp(
virtualCamera.m_Lens.FieldOfView,
Zoom.Allow ?
Mathf.Rad2Deg * CalcZoomFOV(Mathf.Deg2Rad * 60f, Zoom.Value) : PlayerConfig.Singleton.Fov,
16*deltaTime
);
virtualCamera.m_Lens.FieldOfView = Mathf.Lerp(PlayerConfig.Singleton.Fov, targetFov, Aim);
float CalcZoomFOV(float baseFOV, float zoom)
{