// ******************************************************************** // Function: LateUpdate() // Purpose: Called once per frame, after other objects have // updated. // ******************************************************************** void LateUpdate() { if (!m_lerp && m_player.GetAxis(m_scrollAxis) < 0) { PreviousScreen(); } if (!m_lerp && m_player.GetAxis(m_scrollAxis) > 0) { NextScreen(); } if (m_lerp) { float xPos = m_lerpTarget.x; if (Time.time - m_lerpStartTime < m_lerpCurrentDuration) { xPos = Easing.Apply(EasingFunction.QuadEaseOut, Time.time - m_lerpStartTime, m_lerpStartPos.x, m_lerpTarget.x - m_lerpStartPos.x, m_lerpCurrentDuration); m_screensContainer.localPosition = new Vector3(xPos, m_screensContainer.localPosition.y, m_screensContainer.localPosition.z); } else { m_lerp = false; m_momentumEffectivelyStopped = true; m_screensContainer.localPosition = new Vector3(xPos, m_screensContainer.localPosition.y, m_screensContainer.localPosition.z); m_contentsStartPoint = m_screensContainer.localPosition; // to keep current drag in right place } } else if (!m_dragScrollControlScheme.Contains(InputManager.controlScheme) || (m_allowDragOff && !m_allowingThisDrag && m_currentlyDragging)) { m_screensContainer.localPosition = m_contentsStartPoint; } m_centerItem = GetCenterItemIndex(); }
// ******************************************************************** public override int GetProgress_Cumulative() { bool schemeMatch = m_controlScheme.Contains(InputManager.controlScheme); return(schemeMatch ? 1 : 0); }