//Get the height below the given vector public float GetLandingHeight(Vector3 playerPos) { return(Interpolation.CircularIn(GetAirborneDelta(playerPos)) * m_XScale); }
/// <summary> /// The initial flying animation across the screen. /// </summary> IEnumerator FlyAcrossAnimation() { yield return(new WaitForSeconds(m_DelayStart)); while (m_currentTime < m_FlyingAcrossTimeToReachPosition) { transform.position = Vector3.LerpUnclamped(m_desiredPos + m_offset, m_desiredPos, Interpolation.CircularIn(m_currentTime / m_FlyingAcrossTimeToReachPosition)); m_currentTime += Time.deltaTime; yield return(null); } transform.position = m_desiredPos; m_currentTime = 0.0f; SetShipToNewLocation(); }
//Set the angle of the pipe to below the player when they are airborne //While airborne, the circular movement mod does not apply public void SetAngleToAirbornePos(Vector3 playerPos) { m_CurrentAngle = Mathf.Lerp(0, 90, Interpolation.CircularIn(GetAirborneDelta(playerPos))); }