/// <summary> /// Toggles the state of usingRobotView when the button "Toggle Robot Camera" is clicked /// </summary> public void ToggleCameraWindow() { usingRobotView = !usingRobotView; robotCameraViewWindow.SetActive(usingRobotView); if (usingRobotView) { robotCamera.CurrentCamera.GetComponent <Camera>().targetTexture = robotCameraView; } else { //Free the target texture and disable the camera since robot camera has more depth than main camera robotCamera.CurrentCamera.GetComponent <Camera>().targetTexture = null; robotCamera.CurrentCamera.SetActive(false); //Close the panel when indicator is not active and stop all configuration configureCameraPanel.SetActive(false); if (robotCamera.ChangingCameraPosition) { dynamicCamera.SwitchToState(preConfigCamState); } robotCamera.IsChangingHeight = robotCamera.SelectingNode = robotCamera.ChangingCameraPosition = false; configureRobotCameraButton.GetComponentInChildren <Text>().text = "Configure Robot Camera"; robotCamera.SelectingNode = false; robotCamera.SelectedNode = null; } }
/// <summary> /// Close all window related to adding/configuring sensor, also called in SimUI /// </summary> public void EndProcesses() { isChoosingOption = false; if (currentSensor != null) { currentSensor.ResetConfigurationState(); currentSensor = null; } sensorOptionPanel.SetActive(false); sensorTypePanel.SetActive(false); CancelOptionSelection(); CancelTypeSelection(); ResetConfigurationWindow(); //HideSensorOutput(); selectedNode = null; //Switch back to the original camera state if (preConfigState != null) { dynamicCamera.SwitchToState(preConfigState); preConfigState = null; } HideInvisibleSensors(); }
/// <summary> /// Close all window related to adding/configuring sensor, also called in SimUI /// </summary> public void EndProcesses() { isChoosingOption = false; if (currentSensor != null) { currentSensor.ResetConfigurationState(); currentSensor = null; } sensorOptionPanel.SetActive(false); sensorTypePanel.SetActive(false); CancelOptionSelection(); CancelTypeSelection(); ResetConfigurationWindow(); HideSensorOutput(); //configureSensorButton.GetComponentInChildren<Text>().text = "Add/Configure Sensor"; selectedNode = null; if (preConfigState != null) { dynamicCamera.SwitchToState(preConfigState); preConfigState = null; } HideInvisibleSensors(); }
/// <summary> /// Activate the configure camera panel and start position configuration (which is the main configuration state for robot camera) /// </summary> public void ToggleCameraConfiguration() { robotCameraManager.ChangingCameraPosition = !robotCameraManager.ChangingCameraPosition; configureCameraPanel.SetActive(robotCameraManager.ChangingCameraPosition); if (robotCameraManager.ChangingCameraPosition) { preConfigCamState = dynamicCamera.ActiveState; dynamicCamera.SwitchCameraState(new DynamicCamera.ConfigurationState(dynamicCamera, robotCameraManager.CurrentCamera)); } else { configureRobotCameraButton.GetComponentInChildren <Text>().text = "Configure"; ResetConfigurationWindow(); dynamicCamera.SwitchToState(preConfigCamState); } }
/// <summary> /// Activate the configure camera panel and start position configuration (which is the main configuration state for robot camera) /// </summary> public void ToggleCameraConfiguration() { robotCameraManager.ChangingCameraPosition = !robotCameraManager.ChangingCameraPosition; configureCameraPanel.SetActive(robotCameraManager.ChangingCameraPosition); if (robotCameraManager.ChangingCameraPosition) { preConfigCamState = dynamicCamera.cameraState; dynamicCamera.SwitchCameraState(new DynamicCamera.ConfigurationState(dynamicCamera, robotCameraManager.CurrentCamera)); //Update the node where current camera is attached to cameraNodeText.text = "Current Node: " + robotCameraManager.CurrentCamera.transform.parent.gameObject.name; configureRobotCameraButton.GetComponentInChildren <Text>().text = "End"; } else { configureRobotCameraButton.GetComponentInChildren <Text>().text = "Configure"; ResetConfigurationWindow(); dynamicCamera.SwitchToState(preConfigCamState); } }
/// <summary> /// Close all window related to adding/configuring sensor /// </summary> public void EndProcesses() { isChoosingOption = isSelectingSensor = isAddingSensor = isAddingBeamBreaker = isAddingUltrasonic = nodeConfirmed = false; sensorOptionPanel.SetActive(false); ResetConfigurationWindow(); sensorTypePanel.SetActive(false); selectedNode = null; CancelOptionSelection(); configureSensorButton.GetComponentInChildren <Text>().text = "Add/Configure Sensor"; if (currentSensor != null) { currentSensor.ResetConfigurationState(); currentSensor = null; } if (preConfigState != null) { dynamicCamera.SwitchToState(preConfigState); preConfigState = null; } }
/// <summary> /// Close all window related to adding/configuring sensor, also called in SimUI /// </summary> public void EndProcesses() { isChoosingOption = false; if (currentSensor != null) { currentSensor.GetComponentInChildren <MoveArrows>(true).gameObject.SetActive(false); currentSensor.ResetConfigurationState(); currentSensor = null; } //CancelOptionSelection(); //CancelTypeSelection(); ResetConfigurationWindow(); //HideSensorOutput(); //Switch back to the original camera state if (preConfigState != null) { dynamicCamera.SwitchToState(preConfigState); preConfigState = null; } HideInvisibleSensors(); }