コード例 #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);
        }
コード例 #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);
 }
コード例 #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));
        }
コード例 #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));
        }
コード例 #5
0
 public void OneAndThreeAreMoreThanOneApart()
 {
     Assert.False(BowieMath.CompareFloats(1, 3, 1));
 }
コード例 #6
0
 public void OneAndThreeAreLessThanFourApart()
 {
     Assert.True(BowieMath.CompareFloats(1, 3, 4));
 }