public void ShowFocusConfirmationDialog()
    {
        if (RobotsList.Dropdown.dropdownItems.Count == 0 ||
            EndEffectorList.Dropdown.dropdownItems.Count == 0 ||
            OrientationsList.Dropdown.dropdownItems.Count == 0)
        {
            Base.Notifications.Instance.ShowNotification("Failed to update orientation.", "Something is not selected");
            return;
        }
        CustomDropdown robotsListDropdown  = RobotsList.Dropdown;
        CustomDropdown endEffectorDropdown = EndEffectorList.Dropdown;
        CustomDropdown orientationDropdown = OrientationsList.Dropdown;

        if (endEffectorDropdown.dropdownItems.Count == 0)
        {
            FocusConfirmationDialog.EndEffectorId = "";
        }
        else
        {
            FocusConfirmationDialog.EndEffectorId = endEffectorDropdown.selectedText.text;
        }
        FocusConfirmationDialog.RobotId = robotsListDropdown.selectedText.text;

        FocusConfirmationDialog.OrientationId   = CurrentActionPoint.GetNamedOrientationByName(orientationDropdown.selectedText.text).Id;
        FocusConfirmationDialog.OrientationName = orientationDropdown.selectedText.text;
        FocusConfirmationDialog.UpdatePosition  = UpdatePositionToggle.GetComponent <Toggle>().isOn;
        FocusConfirmationDialog.ActionPointId   = CurrentActionPoint.Data.Id;
        FocusConfirmationDialog.ActionPointName = CurrentActionPoint.Data.Name;
        FocusConfirmationDialog.Init();
        FocusConfirmationDialog.WindowManager.OpenWindow();
    }
示例#2
0
        /// <summary>
        /// Adds a New UpdatePositionToggle if one isn't Attached to the update_target. Else, Add a New one to the updater_list.
        /// </summary>
        /// <param name="new_toggle">The New UpdatePositionToggle to Change or Add.</param>
        public static void AddUpdaterToggle(UpdatePositionToggle new_toggle)
        {
            new_toggle.MovementToggle = true;

            if (updater_list.Count > 0)
            {
                for (int i = 0; i < updater_list.Count; i++)
                {
                    UpdatePositionToggle selected_toggle = (UpdatePositionToggle)updater_list[i];

                    if (selected_toggle.getName().Equals(new_toggle.getName()))
                    {
                        updater_list[i] = new_toggle;

                        break;
                    }

                    if (i == updater_list.Count - 1)
                        updater_list.Add(new_toggle);
                }
            }
            else
                updater_list.Add(new_toggle);
        }