Exemplo n.º 1
0
        // 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);
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
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));
        }
Exemplo n.º 4
0
        public void PercentOfDay()
        {
            DateTime time = new DateTime(2008, 3, 1, 12, 0, 0);

            Assert.True(BowieMath.CompareFloats(0.5f, BowieTime.PercentOfDay(time), 0.0001f));
        }
Exemplo n.º 5
0
 public void OneAndThreeAreMoreThanOneApart()
 {
     Assert.False(BowieMath.CompareFloats(1, 3, 1));
 }
Exemplo n.º 6
0
 public void OneAndThreeAreLessThanFourApart()
 {
     Assert.True(BowieMath.CompareFloats(1, 3, 4));
 }