public bool Driven(out int currentValue) { float t; bool isRunning = m_Lerper.Run(out t); if (isRunning) { m_LastValue = (int)((m_End - m_Start) * t + m_Start); } currentValue = m_LastValue; return(isRunning); }
public bool Driven(out Vector3 currentValue) { float t; bool isRunning = m_Lerper.Run(out t); if (isRunning) { m_LastValue = Vector3.Lerp(m_Start, m_End, t); } currentValue = m_LastValue; return(isRunning); }
public bool Driven(out Quaternion currentValue) { float t; bool isRunning = m_Lerper.Run(out t); if (isRunning) { m_LastValue = Quaternion.Slerp(m_Start, m_End, t); } currentValue = m_LastValue; return(isRunning); }
public bool Driven(out Quaternion currentValue) { float t; bool isRunning = m_Lerper.Run(out t); if (isRunning) { //Quaternion.Lerp throws an exception //so i'm using v4 lerp for now m_LastValue = Quaternion.Lerp(m_Start, m_End, t); } currentValue = m_LastValue; return(isRunning); }
public bool Driven(out Rect currentValue) { float t; bool isRunning = m_Lerper.Run(out t); if (isRunning) { float x = Mathf.Lerp(m_Start.x, m_End.x, t); float y = Mathf.Lerp(m_Start.y, m_End.y, t); float w = Mathf.Lerp(m_Start.width, m_End.width, t); float h = Mathf.Lerp(m_Start.height, m_End.height, t); m_LastValue = new Rect(x, y, w, h); } currentValue = m_LastValue; return(isRunning); }