Esempio n. 1
0
 public void MyOnUpdate()
 {
     if (Time.frameCount > FramesToWaitBeforeTesting)
     {
         if (TestOneFrame)
         {
             if (_framesTestedCount == 0)
             {
                 _testingRunner.ForceMeasurement();
             }
         }
         else
         {
             var lastTestFrame = _testingRunner.OneTestConfiguration.FirstTestFrame + _testingRunner.OneTestConfiguration.TestFramesCount;
             if (lastTestFrame > _testingRunner.RequestedTestFrame)
             {
                 if (Time.time - _lastTestTime > TimeToWaitBetweenTests)
                 {
                     _testingRunner.ForceMeasurement();
                     _framesTestedCount++;
                     _testingRunner.RequestedTestFrame++;
                 }
             }
         }
     }
 }
Esempio n. 2
0
        public void MyOnUpdate()
        {
            if (Input.GetKeyDown(KeyCode.O))
            {
                Debug.Log("Wyświetlanie linii o id " + IdOfLineToDraw);
                if (_lastLinesLayoutResult != null)
                {
                    _lineRenderer.RenderLine(_lastLinesLayoutResult, IdOfLineToDraw);
                }
            }

            if (Input.GetKeyDown(KeyCode.I))
            {
                //Debug.Log("Wyświetlanie punktów należących do wszystkich linii");
                //_lineRenderer.RenderAllHatchesPixels(_lastLinesLayoutResult);
            }

            if (Input.GetKeyDown(KeyCode.K))
            {
                Debug.Log("Wyświetlanie punktów należących do linii o id " + IdOfLineToDraw);
                if (_lastLinesLayoutResult != null)
                {
                    _lineRenderer.RenderHatchPixels(_lastLinesLayoutResult, IdOfLineToDraw);
                }
            }

            if (Input.GetMouseButtonDown(2))
            {
                var mousePosition = new IntVector2(Mathf.RoundToInt(Input.mousePosition.x), Mathf.RoundToInt(Input.mousePosition.y));
                if (_lastIdsArray != null)
                {
                    var id = _lastIdsArray[mousePosition.X, mousePosition.Y];
                    Debug.Log("Id pod kursorem: " + id);
                }
            }


            if (Input.GetKeyDown(KeyCode.P))
            {
                if (_testingRunner.InteractionMode == MTestingRunnerGO.MTestInteractionMode.Animation)
                {
                    Debug.Log("Changing interaction mode to free floating");
                    GetComponent <ExtendedFlycam>().enabled = true;
                    _testingRunner.InteractionMode          = MTestingRunnerGO.MTestInteractionMode.FreeFloating;
                }
                else
                {
                    Debug.Log("Changing interaction mode to animation");
                    _testingRunner.InteractionMode          = MTestingRunnerGO.MTestInteractionMode.Animation;
                    GetComponent <ExtendedFlycam>().enabled = false;
                }
            }

            if (_testingRunner.InteractionMode == MTestingRunnerGO.MTestInteractionMode.Animation)
            {
                if (Input.GetKeyDown(KeyCode.Comma) || Input.GetKey(KeyCode.Alpha9))
                {
                    _testingRunner.RequestedTestFrame = Mathf.Max(_testingRunner.RequestedTestFrame - 1, 0);
                }

                if (Input.GetKeyDown(KeyCode.Period) || Input.GetKey(KeyCode.Alpha0))
                {
                    _testingRunner.RequestedTestFrame = Mathf.Min(_testingRunner.RequestedTestFrame + 1, _testingRunner.OneTestConfiguration.FirstTestFrame + _testingRunner.OneTestConfiguration.TestFramesCount);
                }
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                Debug.Log("Forcing measurement");
                _testingRunner.ForceMeasurement();
            }

            _lineRenderer.Update();
        }