private void TryChangeOffset(TransformOffset newOffset) { if (m_CurrentOffset != newOffset) { newOffset.ContinueFrom(m_CurrentOffset); m_CurrentOffset = newOffset; } }
private void Awake() { m_Object = GetComponent <FPObject>(); m_Weapon = m_Object as FPWeaponBase; m_Object.Draw.AddListener(On_Draw); m_Object.Holster.AddListener(On_Holster); SetupTransforms(); Player.Land.AddListener(On_Land); m_CurrentOffset = m_IdleOffset; }
public void ContinueFrom(TransformOffset state) { m_CurrentPosition = state.CurrentPosition; m_CurrentRotation = state.CurrentRotation; }
private void On_Draw() { m_IdleOffset.Reset(); m_CurrentOffset = m_IdleOffset; m_HolsterActive = false; }