Beispiel #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;
 }
Beispiel #2
0
    public void UpdateMenu()
    {
        objectName.text        = CurrentObject.Data.Name;
        VisibilitySlider.value = CurrentObject.GetVisibility() * 100;
        foreach (Transform t in DynamicContent.transform)
        {
            Destroy(t.gameObject);
        }
        foreach (ActionPoint actionPoint in CurrentObject.GetActionPoints())
        {
            Button button = GameManager.Instance.CreateButton(DynamicContent.transform, actionPoint.Data.Name);
            button.onClick.AddListener(() => ShowActionPoint(actionPoint));

            // Add EventTrigger OnPointerEnter and OnPointerExit - to be able to highlight corresponding AP when hovering over button
            OutlineOnClick APoutline    = actionPoint.GetComponent <OutlineOnClick>();
            EventTrigger   eventTrigger = button.gameObject.AddComponent <EventTrigger>();
            // Create OnPointerEnter entry
            EventTrigger.Entry OnPointerEnter = new EventTrigger.Entry {
                eventID = EventTriggerType.PointerEnter
            };
            OnPointerEnter.callback.AddListener((eventData) => APoutline.Highlight());
            eventTrigger.triggers.Add(OnPointerEnter);

            // Create OnPointerExit entry
            EventTrigger.Entry OnPointerExit = new EventTrigger.Entry {
                eventID = EventTriggerType.PointerExit
            };
            OnPointerExit.callback.AddListener((eventData) => APoutline.UnHighlight());
            eventTrigger.triggers.Add(OnPointerExit);
        }
    }
Beispiel #3
0
    public virtual void UpdateMenu()
    {
        objectName.text = CurrentObject.Data.Name;
        // Parameters:

        Parameters.GetComponent <VerticalLayoutGroup>().enabled = true;
        foreach (Transform o in Parameters.transform)
        {
            if (o.name != "Layout" && o.gameObject.tag != "Persistent")
            {
                Destroy(o.gameObject);
            }
        }


        VisibilitySlider.value = CurrentObject.GetVisibility() * 100;
    }
    public void UpdateMenu()
    {
        if (currentFocusPoint >= 0)
        {
            return;
        }
        if (CurrentObject.ActionObjectMetadata.ObjectModel?.Type == IO.Swagger.Model.ObjectModel.TypeEnum.Mesh)
        {
            UpdatePositionBlockVO.SetActive(false);
            UpdatePositionBlockMesh.SetActive(true);
            RobotsListsBlock.SetActive(true);
        }
        else if (CurrentObject.ActionObjectMetadata.ObjectModel != null)
        {
            UpdatePositionBlockVO.SetActive(true);
            UpdatePositionBlockMesh.SetActive(false);
            RobotsListsBlock.SetActive(true);
        }
        else
        {
            UpdatePositionBlockVO.SetActive(false);
            UpdatePositionBlockMesh.SetActive(false);
            RobotsListsBlock.SetActive(false);
        }

        RobotsList.gameObject.GetComponent <DropdownRobots>().Init(OnRobotChanged, true);

        if (RobotsList.Dropdown.dropdownItems.Count > 0)
        {
            OnRobotChanged(RobotsList.Dropdown.selectedText.text);
        }
        else
        {
            UpdatePositionBlockVO.SetActive(false);
            UpdatePositionBlockMesh.SetActive(false);
            RobotsListsBlock.SetActive(false);
        }
        FocusObjectDoneButton.interactable = false;
        NextButton.interactable            = false;
        PreviousButton.interactable        = false;
        objectName.text = CurrentObject.Data.Name;

        VisibilitySlider.value = CurrentObject.GetVisibility() * 100;
    }
    public void UpdateMenu()
    {
        if (currentFocusPoint >= 0)
        {
            return;
        }

        if (SceneManager.Instance.RobotInScene())
        {
            RobotsList.gameObject.GetComponent <DropdownRobots>().Init(OnRobotChanged, true);
            string robotId = null;
            try {
                robotId = SceneManager.Instance.RobotNameToId(RobotsList.GetValue().ToString());
            } catch (ItemNotFoundException ex) {
                Debug.LogError(ex);
                robotId = null;
            }
            if (string.IsNullOrEmpty(robotId))
            {
                Notifications.Instance.ShowNotification("Robot not found", "Robot with name " + RobotsList.GetValue().ToString() + "does not exists");
            }
            else
            {
                OnRobotChanged(robotId);
            }

            if (CurrentObject.ActionObjectMetadata.ObjectModel?.Type == IO.Swagger.Model.ObjectModel.TypeEnum.Mesh)
            {
                UpdatePositionBlockVO.SetActive(false);
                UpdatePositionBlockMesh.SetActive(true);
                RobotsListsBlock.SetActive(true);
            }
            else if (CurrentObject.ActionObjectMetadata.ObjectModel != null)
            {
                UpdatePositionBlockVO.SetActive(true);
                UpdatePositionBlockMesh.SetActive(false);
                RobotsListsBlock.SetActive(true);
                ShowModelSwitch.Interactable = SceneManager.Instance.RobotsEEVisible;
                if (ShowModelSwitch.Interactable && ShowModelSwitch.Switch.isOn)
                {
                    ShowModelOnEE();
                }
            }
            else
            {
                UpdatePositionBlockVO.SetActive(false);
                UpdatePositionBlockMesh.SetActive(false);
                RobotsListsBlock.SetActive(false);
            }
        }
        else
        {
            UpdatePositionBlockVO.SetActive(false);
            UpdatePositionBlockMesh.SetActive(false);
            RobotsListsBlock.SetActive(false);
        }


        FocusObjectDoneButton.interactable = false;
        NextButton.interactable            = false;
        PreviousButton.interactable        = false;
        objectName.text = CurrentObject.Data.Name;

        VisibilitySlider.value = CurrentObject.GetVisibility() * 100;
    }