private void InitTile(string projectId) { string filename = PlayerPrefsHelper.LoadString(projectId + "/image", ""); if (!string.IsNullOrEmpty(filename) && File.Exists(filename)) { Sprite sprite = ImageHelper.LoadNewSprite(filename); TopImage.sprite = sprite; } }
public void InitTile(string sceneUserId, UnityAction mainCallback, UnityAction optionCallback, bool starVisible, DateTime created, DateTime modified, string sceneId) { base.InitTile(sceneUserId, mainCallback, optionCallback, starVisible, created, modified); SceneId = sceneId; string filename = PlayerPrefsHelper.LoadString(SceneId + "/image", ""); if (!string.IsNullOrEmpty(filename) && File.Exists(filename)) { Sprite sprite = ImageHelper.LoadNewSprite(filename); TopImage.sprite = sprite; } SetTimestamp(modified.ToString()); }
public void InitTile(string sceneUserId, UnityAction mainCallback, UnityAction optionCallback, bool starVisible, string sceneId, string timestamp) { base.InitTile(sceneUserId, mainCallback, optionCallback, starVisible); SceneId = sceneId; string filename = PlayerPrefsHelper.LoadString(SceneId + "/image", ""); if (!string.IsNullOrEmpty(filename) && File.Exists(filename)) { Sprite sprite = ImageHelper.LoadNewSprite(filename); TopImage.sprite = sprite; } this.timestamp.text = "Last modified: " + timestamp; }
public string GetProjectServiceURI(bool complete = true) { string uri = PlayerPrefsHelper.LoadString("ProjectServiceURI", ""); string suffix = complete ? "/files/" : ""; if (string.IsNullOrEmpty(uri)) { return("http://" + WebsocketManager.Instance.GetServerDomain() + ":6790" + suffix); } else { return(uri + suffix); } }
public void InitTile(string sceneUserId, UnityAction mainCallback, UnityAction optionCallback, bool starVisible, DateTime created, DateTime modified, string packageId, string projectName, string timestamp) { base.InitTile(sceneUserId, mainCallback, optionCallback, starVisible, created, modified); PackageId = packageId; string filename = PlayerPrefsHelper.LoadString(packageId + "/image", ""); if (!string.IsNullOrEmpty(filename)) { Sprite sprite = ImageHelper.LoadNewSprite(filename); TopImage.sprite = sprite; } this.projectName.text = "Project: " + projectName; this.timestamp.text = "Created: " + timestamp; }
public void InitTile(string name, UnityAction mainCallback, UnityAction optionCallback, bool starVisible, DateTime created, DateTime modified, string projectId, string sceneId, string sceneName) { base.InitTile(name, mainCallback, optionCallback, starVisible, created, modified); ProjectId = projectId; SceneId = sceneId; string filename = PlayerPrefsHelper.LoadString(projectId + "/image", ""); if (!string.IsNullOrEmpty(filename) && File.Exists(filename)) { Sprite sprite = ImageHelper.LoadNewSprite(filename); TopImage.sprite = sprite; } this.sceneName.text = "Scene: " + sceneName; SetTimestamp(modified.ToString()); }
public async Task <bool> Open(UnityAction closeCallback) { if (!SceneManager.Instance.RobotInScene()) { Notifications.Instance.ShowNotification("Failed to open robot selector menu", "There are no robots in scene"); closeCallback.Invoke(); return(false); } _closeCallback = closeCallback; robotId = PlayerPrefsHelper.LoadString(SceneManager.Instance.SceneMeta.Id + "/selectedRobotId", null); eeId = PlayerPrefsHelper.LoadString(SceneManager.Instance.SceneMeta.Id + "/selectedEndEffectorId", null); if (!SceneManager.Instance.SceneStarted) { Notifications.Instance.ShowNotification("Failed to open robot selector", "Scene offline"); return(false); } base.Open(); string robotName = null; try { IRobot robot = SceneManager.Instance.GetRobot(robotId); robotName = robot.GetName(); } catch (ItemNotFoundException ex) { robotName = null; } DropdownRobots.Dropdown.Dropdown.dropdownItems.Clear(); await DropdownRobots.Init(SelectRobot, false, robotName); if (DropdownRobots.Dropdown.Dropdown.dropdownItems.Count > 0) { SelectRobot(DropdownRobots.Dropdown.GetValue().ToString()); return(true); } else { Notifications.Instance.ShowNotification("Failed to open robot selector menu", "There are no robots in scene"); Close(); return(false); } }
private void Awake() { UsingServerCalibration = PlayerPrefsHelper.LoadBool("UseServerCalibration", true); UpdateAutoCalibTime(float.Parse(PlayerPrefsHelper.LoadString("/autoCalib/recalibrationTime", "120"))); }
private void OnProjectOrSceneLoaded(bool project) { foreach (GameObject obj in ProjectRelatedSettings) { obj.SetActive(project); } if (project) { APSizeSlider.gameObject.SetActive(true); APOrientationsVisibility.gameObject.SetActive(true); APSizeSlider.value = ProjectManager.Instance.APSize; APOrientationsVisibility.SetValue(Base.ProjectManager.Instance.APOrientationsVisible); SwitchToProjectParametersBtn.SetInteractivity(true); SwitchToProjectParametersBtnImage.color = Color.white; GenerateParameterButtons(); WebsocketManager.Instance.OnProjectParameterAdded += OnProjectParameterAdded; WebsocketManager.Instance.OnProjectParameterRemoved += OnProjectParameterRemoved; } else { APSizeSlider.gameObject.SetActive(false); APOrientationsVisibility.gameObject.SetActive(false); SwitchToProjectParametersBtn.SetInteractivity(false, "Project parameters are available only in project editor."); SwitchToProjectParametersBtnImage.color = Color.gray; } Interactibility.SetValue(Base.SceneManager.Instance.ActionObjectsInteractive); RobotsEEVisible.SetValue(Base.SceneManager.Instance.RobotsEEVisible, false); ActionObjectsVisibilitySlider.SetValueWithoutNotify(SceneManager.Instance.ActionObjectsVisibility * 100f); #if UNITY_ANDROID && AR_ON recalibrationTime.SetValue(CalibrationManager.Instance.AutoRecalibrateTime); Trackables.SetValue(PlayerPrefsHelper.LoadBool("control_box_display_trackables", false)); CalibrationElements.Interactable = false; CalibrationElements.SetValue(true); CalibrationElementsTooltip.DisplayAlternativeDescription = true; bool useAutoCalib = PlayerPrefsHelper.LoadBool("control_box_autoCalib", true); AutoCalibTooltip.DisplayAlternativeDescription = useAutoCalib; AutoCalibration.SetValue(useAutoCalib); // If the toggle is unchanged, we need to manually call the EnableAutoReCalibration function. // If the toggle has changed, the function will be called automatically. So we need to avoid calling it twice. if (((bool)AutoCalibration.GetValue() && useAutoCalib) || (!(bool)AutoCalibration.GetValue() && !useAutoCalib)) { EnableAutoReCalibration(useAutoCalib); } #endif ConnectionsSwitch.SetValue(PlayerPrefsHelper.LoadBool("control_box_display_connections", true)); recalibrationTime.SetValue(PlayerPrefsHelper.LoadString("/autoCalib/recalibrationTime", "120")); string uri = PlayerPrefsHelper.LoadString("ProjectServiceURI", ""); ProjectServiceURI.Input.SetValue(GetProjectServiceURI(false)); if (string.IsNullOrEmpty(uri)) { ResetProjectServiceURIButton.SetInteractivity(false, "Default value is already set"); } else { ResetProjectServiceURIButton.SetInteractivity(true); } }