public float StartFade(float TimeToCompleat, eTranitionStart whereToStart = eTranitionStart.START) { m_fade = true; m_timeToCompleat = TimeToCompleat; switch (whereToStart) { case eTranitionStart.START: m_speed = 1.0f / TimeToCompleat; m_currentThreshold = 0; TransitionMaterial.SetFloat("_Threshold", m_currentThreshold); break; case eTranitionStart.END: m_speed = -1.0f / TimeToCompleat; m_currentThreshold = 1; TransitionMaterial.SetFloat("_Threshold", m_currentThreshold); break; } return(TimeToCompleat); }
public void StopFade(eTranitionStart where_to_stop) { m_fade = false; TransitionMaterial.SetFloat("_Threshold", where_to_stop == eTranitionStart.START ? 0.0f : 1.0f); }