Пример #1
0
 /// <summary>
 /// Changes the active robot to a new robot with a given directory
 /// </summary>
 /// <param name="directory"></param>
 /// <returns>whether the process was successful</returns>
 public bool ChangeRobot(string directory)
 {
     sensorManager.RemoveSensorsFromRobot(activeRobot);
     sensorManagerGUI.ShiftOutputPanels();
     sensorManagerGUI.EndProcesses();
     return(activeRobot.InitializeRobot(directory, this));
 }
Пример #2
0
 public void EndProcesses(bool toolkitWindowOn = false)
 {
     ToggleRulerWindow(false);
     toolkitWindow.SetActive(toolkitWindowOn);
     ToggleStatsWindow(false);
     ToggleStopwatchWindow(false);
     sensorManagerGUI.EndProcesses();
 }
Пример #3
0
        /// <summary>
        /// Call this function whenever the user enters a new state (ex. selecting a new robot, using ruler function, orenting robot)
        /// </summary>
        public void EndOtherProcesses()
        {
            changeFieldPanel.SetActive(false);
            changeRobotPanel.SetActive(false);
            changePanel.SetActive(false);
            addPanel.SetActive(false);
            pointImpulsePanel.SetActive(false);

            toolkit.EndProcesses();
            multiplayer.EndProcesses();
            sensorManagerGUI.EndProcesses();
            robotCameraGUI.EndProcesses();
        }
Пример #4
0
    /// <summary>
    /// Changes the active robot to a new robot with a given directory
    /// </summary>
    /// <param name="directory"></param>
    /// <returns>whether the process was successful</returns>
    public bool ChangeRobot(string directory, bool isMixAndMatch)
    {
        sensorManager.RemoveSensorsFromRobot(ActiveRobot);
        sensorManagerGUI.ShiftOutputPanels();
        sensorManagerGUI.EndProcesses();
        if (ActiveRobot.RobotHasManipulator)
        {
            ActiveRobot.DeleteManipulatorNodes();
            ActiveRobot.RobotHasManipulator = false;
        }

        ActiveRobot.RobotIsMixAndMatch = isMixAndMatch;
        return(ActiveRobot.InitializeRobot(directory, this));
    }
Пример #5
0
        public void EndProcesses(bool toolkitWindowOn = false)
        {
            ToggleRulerWindow(false);

            //Reset the stopwatch stuff
            if (stopwatchOn)
            {
                ResetStopwatch();
                ToggleStopwatch();
            }

            ToggleStatsWindow(false);
            ToggleStopwatchWindow(false);
            sensorManagerGUI.EndProcesses();
        }
        /// <summary>
        /// Call this function whenever the user enters a new state (ex. selecting a new robot, using ruler function, orenting robot)
        /// </summary>
        public void EndOtherProcesses()
        {
            changeFieldPanel.SetActive(false);
            changeRobotPanel.SetActive(false);
            changePanel.SetActive(false);
            addPanel.SetActive(false);
            inputManagerPanel.SetActive(false);

            simUI.CancelOrientation();

            toolkit.EndProcesses();
            multiplayer.EndProcesses();
            sensorManagerGUI.EndProcesses();
            robotCameraGUI.EndProcesses();
        }
Пример #7
0
        /// <summary>
        /// Call this function whenever the user enters a new state (ex. selecting a new robot, using ruler function, orenting robot)
        /// </summary>
        public void EndOtherProcesses()
        {
            changeFieldPanel.SetActive(false);
            changeRobotPanel.SetActive(false);
            exitPanel.SetActive(false);
            mixAndMatchPanel.SetActive(false);
            changePanel.SetActive(false);
            addPanel.SetActive(false);

            betaWarningPanel.SetActive(false);

            toolkit.EndProcesses();
            multiplayer.EndProcesses();
            sensorManagerGUI.EndProcesses();
            robotCameraGUI.EndProcesses();
        }
Пример #8
0
    /// <summary>
    /// Call this function whenever the user enters a new state (ex. selecting a new robot, using ruler function, orenting robot)
    /// </summary>
    public void EndOtherProcesses()
    {
        changeFieldPanel.SetActive(false);
        changeRobotPanel.SetActive(false);
        exitPanel.SetActive(false);
        mixAndMatchPanel.SetActive(false);

        CloseOrientWindow();
        main.IsResetting = false;

        dpm.EndProcesses();
        toolkit.EndProcesses();
        multiplayer.EndProcesses();

        sensorManagerGUI.EndProcesses();
    }
Пример #9
0
        /// <summary>
        /// Changes the active robot to a new robot with a given directory
        /// </summary>
        /// <param name="directory"></param>
        /// <returns>whether the process was successful</returns>
        public bool ChangeRobot(string directory, bool isMixAndMatch)
        {
            sensorManager.RemoveSensorsFromRobot(ActiveRobot);
            sensorManagerGUI.ShiftOutputPanels();
            sensorManagerGUI.EndProcesses();

            RemoveRobot(SpawnedRobots.IndexOf(ActiveRobot));
            //ActiveRobot = null;

            if (LoadRobot(directory, isMixAndMatch))
            {
                DynamicCamera.ControlEnabled = true;
                return(true);
            }

            return(false);
        }
Пример #10
0
    /// <summary>
    /// Call this function whenever the user enters a new state (ex. selecting a new robot, using ruler function, orenting robot)
    /// </summary>
    public void EndOtherProcesses()
    {
        changeFieldPanel.SetActive(false);
        changeRobotPanel.SetActive(false);
        exitPanel.SetActive(false);
        mixAndMatchPanel.SetActive(false);
        analyticsPanel.SetActive(false);

        CancelOrientation();
        main.IsResetting = false;

        dpm.EndProcesses();
        toolkit.EndProcesses();
        multiplayer.EndProcesses();
        sensorManagerGUI.EndProcesses();
        robotCameraGUI.EndProcesses();
    }
Пример #11
0
        /// <summary>
        /// Call this function whenever the user enters a new state (ex. selecting a new robot, using ruler function, orenting robot)
        /// </summary>
        public void EndOtherProcesses()
        {
            changeFieldPanel.SetActive(false);
            changeRobotPanel.SetActive(false);
            exitPanel.SetActive(false);
            mixAndMatchPanel.SetActive(false);
            changePanel.SetActive(false);
            addPanel.SetActive(false);
            analyticsPanel.SetActive(false);
            inputManagerPanel.SetActive(false);
            ToggleHotKeys(false);

            CancelOrientation();

            toolkit.EndProcesses();
            multiplayer.EndProcesses();
            sensorManagerGUI.EndProcesses();
            robotCameraGUI.EndProcesses();
        }
Пример #12
0
 /// <summary>
 /// Toggles the state of usingRobotView when the camera button in toolbar is clicked
 /// </summary>
 public void ToggleCameraWindow()
 {
     //Deal with UI conflicts (configuration stuff) between robot camera & sensors
     sensorManagerGUI.EndProcesses();
     usingRobotView = !usingRobotView;
     robotCameraViewWindow.SetActive(usingRobotView);
     if (usingRobotView)
     {
         robotCameraManager.CurrentCamera.GetComponent <Camera>().targetTexture = robotCameraView;
     }
     else
     {
         //Free the target texture and disable the camera since robot camera has more depth than main camera
         robotCameraManager.CurrentCamera.GetComponent <Camera>().targetTexture = null;
         robotCameraManager.CurrentCamera.SetActive(false);
         //Close the panel when indicator is not active and stop all configuration
         configureCameraPanel.SetActive(false);
         configureRobotCameraButton.GetComponentInChildren <Text>().text = "Configure";
         EndProcesses();
     }
 }
Пример #13
0
        /// <summary>
        /// Changes the active robot to a new robot with a given directory
        /// </summary>
        /// <param name="directory"></param>
        /// <returns>whether the process was successful</returns>
        public bool ChangeRobot(string directory, bool isMixAndMatch)
        {
            sensorManager.RemoveSensorsFromRobot(ActiveRobot);
            sensorManagerGUI.ShiftOutputPanels();
            sensorManagerGUI.EndProcesses();

            int index = SpawnedRobots.IndexOf(ActiveRobot);

            robotCameraManager.RemoveCamerasFromRobot(SpawnedRobots[index]);
            sensorManager.RemoveSensorsFromRobot(SpawnedRobots[index]);

            MaMRobot mamRobot = SpawnedRobots[index] as MaMRobot;

            if (mamRobot != null && mamRobot.RobotHasManipulator)
            {
                UnityEngine.Object.Destroy(mamRobot.ManipulatorObject);
            }

            UnityEngine.Object.Destroy(SpawnedRobots[index].gameObject);
            ActiveRobot = null;

            if (LoadRobot(directory, isMixAndMatch, index))
            {
                DynamicCamera.ControlEnabled = true;

                int i = 0;
                foreach (SimulatorRobot robot in SpawnedRobots)
                {
                    robot.ControlIndex = i;
                    i++;
                }

                return(true);
            }

            return(false);
        }