// Update is called once per frame void Update() { if (!BowieMath.CompareVectors(_lastMousePosition, Input.mousePosition)) { _lastMouseMoveTime = Time.fixedTime; } _lastMousePosition = Input.mousePosition; Cursor.visible = (Time.fixedTime - _lastMouseMoveTime < hideMouseAfter); }
public float GetValue(float time) { if (type == MotionType.Sine) { return(BowieMath.SineF(time + offset, amplitude, cyclesPerSecond)); } else if (type == MotionType.Tan) { return(BowieMath.TanF(time + offset, amplitude, cyclesPerSecond)); } else if (type == MotionType.Cos) { return(BowieMath.SineF(time + offset, amplitude, cyclesPerSecond)); } return(0); }
public void PercentOfYear() { DateTime time = new DateTime(2009, 7, 1, 0, 0, 0); Assert.True(BowieMath.CompareFloats(0.5f, BowieTime.PercentOfYear(time), 0.01f)); }
public void PercentOfDay() { DateTime time = new DateTime(2008, 3, 1, 12, 0, 0); Assert.True(BowieMath.CompareFloats(0.5f, BowieTime.PercentOfDay(time), 0.0001f)); }
public void OneAndThreeAreMoreThanOneApart() { Assert.False(BowieMath.CompareFloats(1, 3, 1)); }
public void OneAndThreeAreLessThanFourApart() { Assert.True(BowieMath.CompareFloats(1, 3, 4)); }