3 [
Attribute(
"", UIWidgets.Auto,
desc:
"Individual FOV settings.")]
4 protected ref array<float> m_aFOVs;
7 protected float m_fInterpolationSpeed;
10 protected float m_fCurrentFOV = 60.0;
13 protected int m_iCurrentIndex = -1;
19 override int GetCount()
21 return m_aFOVs.Count();
28 override int GetCurrentIndex()
30 return m_iCurrentIndex;
38 protected override void SetIndex(
int index)
40 m_iCurrentIndex =
index;
49 protected override void OnInit(IEntity owner, BaseSightsComponent sights)
55 m_fCurrentFOV = m_aFOVs[0];
68 protected override void OnUpdate(IEntity owner, BaseSightsComponent sights,
float timeSlice)
70 if (!m_aFOVs.IsIndexValid(m_iCurrentIndex))
73 float target = m_aFOVs[m_iCurrentIndex];
74 m_fCurrentFOV = Math.Lerp(m_fCurrentFOV, target, timeSlice * m_fInterpolationSpeed);
79 override bool IsAdjusting()
81 if (!m_aFOVs.IsIndexValid(m_iCurrentIndex))
84 return !
float.AlmostEqual(m_fCurrentFOV, m_aFOVs[m_iCurrentIndex]);
92 protected override float GetCurrentFOV()
104 override float GetBaseFOV()
106 if (!m_aFOVs.IsEmpty())
109 return m_fCurrentFOV;