public void InterpolatePositiveValues() { var lerp = new LerpByTime(0, 10f, 2f); lerp.Eval(1f); Assert.AreEqual(5f, lerp.CurrentValue); lerp.Eval(1f); Assert.AreEqual(10f, lerp.CurrentValue); }
public void InterpolateNegativeValues() { var lerp = new LerpByTime(-10f, 0f, 2f); lerp.Eval(1f); Assert.AreEqual(-5f, lerp.CurrentValue); lerp.Eval(1f); Assert.AreEqual(0f, lerp.CurrentValue); }
public BloodSplatter Setup(float displayTime, Vector2 canvasSize) { var rect = transform.GetComponent <RectTransform>(); rect.position = new Vector3( Random.Range(0, canvasSize.x), Random.Range(0, canvasSize.y), 0f ); DisplayTime = displayTime; lerp = new LerpByTime(1f, 0f, DisplayTime); return(this); }
public void ShouldNotChangeValueIfTimeDidntPassed() { var lerp = new LerpByTime(0, 10f, 2f); Assert.AreEqual(0f, lerp.CurrentValue); }