public void ChangeRobot() { GameObject panel = GameObject.Find("RobotListPanel"); string directory = PlayerPrefs.GetString("RobotDirectory") + Path.DirectorySeparatorChar + panel.GetComponent <ChangeRobotScrollable>().selectedEntry; if (Directory.Exists(directory)) { panel.SetActive(false); changeRobotPanel.SetActive(false); InputControl.EnableSimControls(); PlayerPrefs.SetString("simSelectedReplay", string.Empty); PlayerPrefs.SetString("simSelectedRobot", directory); PlayerPrefs.SetString("simSelectedRobotName", panel.GetComponent <ChangeRobotScrollable>().selectedEntry); PlayerPrefs.SetInt("hasManipulator", 0); //0 is false, 1 is true PlayerPrefs.Save(); AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.ChangeRobot, AnalyticsLedger.EventAction.Clicked, "Robot - Exported", AnalyticsLedger.getMilliseconds().ToString()); robotCameraManager.DetachCamerasFromRobot(State.ActiveRobot); sensorManager.RemoveSensorsFromRobot(State.ActiveRobot); State.ChangeRobot(directory, false); RobotTypeManager.IsMixAndMatch = false; } else { UserMessageManager.Dispatch("Robot directory not found!", WARNING_TIME); } }
public void Update() { if (menuPanel.activeSelf) { InputControl.DisableSimControls(); } if (lastActive && !menuPanel.activeSelf) { InputControl.EnableSimControls(); } lastActive = menuPanel.activeSelf; }
public void ToggleMaMPanel() { if (mixAndMatchPanel.activeSelf) { mixAndMatchPanel.SetActive(false); InputControl.EnableSimControls(); } else { simUI.EndOtherProcesses(); mixAndMatchPanel.SetActive(true); InputControl.DisableSimControls(); } }
public void ToggleChangeRobotPanel() { if (changeRobotPanel.activeSelf) { changeRobotPanel.SetActive(false); InputControl.EnableSimControls(); } else { EndOtherProcesses(); changeRobotPanel.SetActive(true); robotListPanel.SetActive(true); InputControl.DisableSimControls(); Auxiliary.FindObject(changeRobotPanel, "PathLabel").GetComponent <Text>().text = PlayerPrefs.GetString("RobotDirectory"); } }
/// <summary> /// Reset to the empty grid /// </summary> public void LoadEmptyGrid() { changeFieldPanel.SetActive(false); InputControl.EnableSimControls(); loadingPanel.SetActive(true); PlayerPrefs.SetString("simSelectedField", PlayerPrefs.GetString("FieldDirectory") + Path.DirectorySeparatorChar + UnityFieldDefinition.EmptyGridName); PlayerPrefs.SetString("simSelectedFieldName", UnityFieldDefinition.EmptyGridName); PlayerPrefs.Save(); FieldDataHandler.LoadFieldMetaData(PlayerPrefs.GetString("simSelectedField")); AnalyticsManager.GlobalInstance.LogTimingAsync(AnalyticsLedger.TimingCatagory.MainSimulator, AnalyticsLedger.TimingVarible.Playing, AnalyticsLedger.TimingLabel.ResetField); SceneManager.LoadScene("Scene"); AnalyticsManager.GlobalInstance.StartTime(AnalyticsLedger.TimingLabel.ChangeField, AnalyticsLedger.TimingVarible.Playing); // start timer for current field }
/// <summary> /// These toggle, change, and add functions are tethered in Unity /// </summary> public void ToggleChangeFieldPanel() { if (changeFieldPanel.activeSelf) { changeFieldPanel.SetActive(false); InputControl.EnableSimControls(); } else { EndOtherProcesses(); changeFieldPanel.SetActive(true); if (GameObject.Find("Field").transform.childCount > 1) { loadEmptyFieldButton.SetActive(true); } else { loadEmptyFieldButton.SetActive(false); } InputControl.DisableSimControls(); Auxiliary.FindObject(changeFieldPanel, "PathLabel").GetComponent <Text>().text = PlayerPrefs.GetString("FieldDirectory"); } }
public void ChangeField() { GameObject panel = GameObject.Find("FieldListPanel"); string directory = PlayerPrefs.GetString("FieldDirectory") + Path.DirectorySeparatorChar + panel.GetComponent <ChangeFieldScrollable>().selectedEntry; if (Directory.Exists(directory)) { panel.SetActive(false); changeFieldPanel.SetActive(false); InputControl.EnableSimControls(); loadingPanel.SetActive(true); PlayerPrefs.SetString("simSelectedReplay", string.Empty); PlayerPrefs.SetString("simSelectedField", directory); PlayerPrefs.SetString("simSelectedFieldName", panel.GetComponent <ChangeFieldScrollable>().selectedEntry); PlayerPrefs.Save(); AnalyticsManager.GlobalInstance.LogTimingAsync(AnalyticsLedger.TimingCatagory.MainSimulator, AnalyticsLedger.TimingVarible.Playing, AnalyticsLedger.TimingLabel.ResetField); AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.ChangeField, AnalyticsLedger.EventAction.Changed, panel.GetComponent <ChangeFieldScrollable>().selectedEntry.ToString(), AnalyticsLedger.getMilliseconds().ToString()); //FieldDataHandler.LoadFieldMetaData(directory); //DPMDataHandler.Load(); //Controls.Load(); SceneManager.LoadScene("Scene"); AnalyticsManager.GlobalInstance.StartTime(AnalyticsLedger.TimingLabel.ChangeField, AnalyticsLedger.TimingVarible.Playing); // start timer for current field } else { UserMessageManager.Dispatch("Field directory not found!", WARNING_TIME); } }