1
This commit is contained in:
@@ -15,6 +15,7 @@ using BITKit.Entities.Melee;
|
||||
using BITKit.Entities.VFX;
|
||||
using Cinemachine;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Unity.Mathematics;
|
||||
|
||||
namespace BITKit.Entities
|
||||
{
|
||||
@@ -171,7 +172,7 @@ namespace BITKit.Entities
|
||||
|
||||
[SerializeField] private Optional<int> overrideIndex;
|
||||
|
||||
[SerializeField] private AnimationCurve zoomCurve;
|
||||
[SerializeField] private Optional<GameObject> optionalScope;
|
||||
|
||||
public event Action<IBasicItem> OnEquip;
|
||||
public event Action<IBasicItem> OnUnEquip;
|
||||
@@ -180,7 +181,6 @@ namespace BITKit.Entities
|
||||
|
||||
private readonly EntryGroup<IEquipBase> equips = new();
|
||||
protected IEquipBase entryComplete;
|
||||
private PlayerConfig playerConfig;
|
||||
|
||||
private IBasicItem _currentItem;
|
||||
|
||||
@@ -244,7 +244,24 @@ namespace BITKit.Entities
|
||||
|
||||
if (virtualCamera is not null)
|
||||
{
|
||||
virtualCamera.m_Lens.FieldOfView =zoomCurve.Evaluate(Zoom.Allow?Zoom.Value:0);
|
||||
virtualCamera.m_Lens.FieldOfView =
|
||||
Mathf.Lerp(
|
||||
virtualCamera.m_Lens.FieldOfView,
|
||||
Zoom.Allow ?
|
||||
Mathf.Rad2Deg * CalcZoomFOV(Mathf.Deg2Rad * 60f, Zoom.Value) : PlayerConfig.Singleton.Fov,
|
||||
16*deltaTime
|
||||
);
|
||||
|
||||
|
||||
float CalcZoomFOV(float baseFOV, float zoom)
|
||||
{
|
||||
return 2.0f * Mathf.Atan(Mathf.Tan(baseFOV / 2.0f) / zoom);
|
||||
}
|
||||
}
|
||||
|
||||
if (optionalScope.Allow)
|
||||
{
|
||||
optionalScope.Value.SetActive(AllowScope);
|
||||
}
|
||||
|
||||
if (overrideIndex.Allow && (_health?.IsAlive ?? true))
|
||||
|
Reference in New Issue
Block a user