Exemple #1
0
 public virtual void UpdateMenu()
 {
     // Parameters:
     ObjectHasNoParameterLabel.SetActive(CurrentObject.ObjectParameters.Count == 0);
     BlocklistSwitch.SetValue(CurrentObject.Blocklisted);
     Parameters.GetComponent <VerticalLayoutGroup>().enabled = true;
     foreach (Transform o in Parameters.transform)
     {
         if (o.name != "Layout" && o.gameObject.tag != "Persistent")
         {
             Destroy(o.gameObject);
         }
     }
     if (GameManager.Instance.GetGameState() == GameManager.GameStateEnum.SceneEditor)
     {
         UpdateMenuScene();
     }
     else
     {
         UpdateMenuProject();
     }
     VisibilitySlider.gameObject.SetActive(CurrentObject.ActionObjectMetadata.HasPose);
     if (CurrentObject.ActionObjectMetadata.HasPose)
     {
         VisibilityLabel.text = "Visibility:";
     }
     else
     {
         VisibilityLabel.text = "Can't set visibility for objects without pose";
     }
     UpdateSaveBtn();
     VisibilitySlider.value = CurrentObject.GetVisibility() * 100;
 }
Exemple #2
0
 public void UpdateMenu()
 {
     APSizeSlider.value = ProjectManager.Instance.APSize;
     Visiblity.SetValue(Base.SceneManager.Instance.ActionObjectsVisible);
     Interactibility.SetValue(Base.SceneManager.Instance.ActionObjectsInteractive);
     APOrientationsVisibility.SetValue(Base.ProjectManager.Instance.APOrientationsVisible);
     RobotsEEVisible.SetValue(Base.SceneManager.Instance.RobotsEEVisible);
 }
Exemple #3
0
 public bool Init(List <string> cameraNames, string robotId)
 {
     if (cameraNames.Count == 0)
     {
         Notifications.Instance.ShowNotification("Calibration failed", "Could not calibrate robot wihtout camera");
         Close();
         return(false);
     }
     Switch.SetValue(false);
     Dropdown.PutData(cameraNames, "", null);
     this.robotId = robotId;
     return(true);
 }
 public void OnSceneOrProjectLoaded(object sender, EventArgs eventArgs) {
     Visiblity.SetValue(Base.Scene.Instance.ActionObjectsVisible);        
     Interactibility.SetValue(Base.Scene.Instance.ActionObjectsInteractive);
 }
Exemple #5
0
    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);
        }
    }