Esempio n. 1
0
    /// <summary>
    /// Called every step of the program to listen to input commands for various features
    /// </summary>
    public override void Update()
    {
        //If the reset button is held down after a certain amount of time, then go into change spawnpoint mode (reset spawnpoint feature)
        //Otherwise, reset the robot normally (quick reset feature)
        if (!activeRobot.IsResetting)
        {
            if (Input.GetKeyDown(KeyCode.U))
            {
                LoadRobot(robotPath);
            }
            if (Input.GetKeyDown(KeyCode.Y))
            {
                SwitchActiveRobot();
            }
        }

        // Toggles between the different camera states if the camera toggle button is pressed
        if ((InputControl.GetButtonDown(Controls.buttons[0].cameraToggle)))
        {
            if (dynamicCameraObject.activeSelf && DynamicCamera.MovingEnabled)
            {
                dynamicCamera.ToggleCameraState(dynamicCamera.cameraState);
            }
        }

        // Switches to replay mode
        if (!activeRobot.IsResetting && Input.GetKeyDown(KeyCode.Tab))
        {
            CollisionTracker.Synchronize(lastFrameCount);
            StateMachine.Instance.PushState(new ReplayState(fieldPath, robotPath, CollisionTracker.ContactPoints, Trackers));
        }

        UpdateTrackers();
    }
Esempio n. 2
0
 public void StartReplay()
 {
     if (!activeRobot.IsResetting)
     {
         CollisionTracker.Synchronize(lastFrameCount);
         StateMachine.Instance.PushState(new ReplayState(fieldPath, robotPath, CollisionTracker.ContactPoints, Trackers));
     }
 }
Esempio n. 3
0
 public void EnterReplayState()
 {
     if (!activeRobot.IsResetting)
     {
         CollisionTracker.Synchronize(lastFrameCount);
         StateMachine.Instance.PushState(new ReplayState(fieldPath, robotPath, CollisionTracker.ContactPoints, Trackers));
     }
     else
     {
         UserMessageManager.Dispatch("Please finish resetting before entering replay mode!", 5f);
     }
 }