public void Fade(float time, FadeInfo fadeInfo, FadeLayout state) { state.CanvasGrouup.alpha = TPMath.PingPong(time * 2, 1f); if (time >= 0.5f && !string.IsNullOrEmpty(fadeInfo.FadeToScene)) { SceneManager.LoadScene(fadeInfo.FadeToScene); } }
public void PingPong() { CompareFloats(0, TPMath.PingPong(0, 1)); CompareFloats(0.1f, TPMath.PingPong(0.1f, 1)); CompareFloats(0.5f, TPMath.PingPong(0.5f, 1)); CompareFloats(0.9f, TPMath.PingPong(0.9f, 1)); CompareFloats(1, TPMath.PingPong(1, 1)); CompareFloats(0.9f, TPMath.PingPong(1.1f, 1)); CompareFloats(0.8f, TPMath.PingPong(1.2f, 1)); CompareFloats(0.7f, TPMath.PingPong(1.3f, 1)); CompareFloats(0.6f, TPMath.PingPong(1.4f, 1)); CompareFloats(0.2f, TPMath.PingPong(1.8f, 1)); }