Esempio n. 1
0
        public void UpdateOrientation(NamedOrientation orientation)
        {
            NamedOrientation originalOrientation = GetOrientation(orientation.Id);

            originalOrientation.Orientation = orientation.Orientation;
            BaseUpdateOrientation(originalOrientation, orientation);
        }
Esempio n. 2
0
    public void ShowMenu(Base.ActionPoint currentActionPoint, NamedOrientation orientation)
    {
        this.orientation         = orientation;
        this.isOrientationDetail = true;

        ShowMenu(currentActionPoint);
    }
Esempio n. 3
0
 private void OnActionPointOrientationUpdated(object sender, ActionPointOrientationEventArgs args)
 {
     if (orientation != null && orientation.Id == args.Data.Id)
     {
         orientation = args.Data;
         UpdateMenu();
     }
 }
Esempio n. 4
0
        private void AddNewOrientationVisual(NamedOrientation orientation)
        {
            APOrientation apOrientation = Instantiate(ActionsManager.Instance.ActionPointOrientationPrefab, orientations.transform).GetComponent <APOrientation>();

            apOrientation.ActionPoint = this;
            apOrientation.SetOrientation(orientation.Orientation);
            apOrientation.OrientationId = orientation.Id;
        }
    private void OpenDetailMenu(NamedOrientation orientation)
    {
        OrientationJointsDetailMenu.ShowMenu(CurrentActionPoint, orientation);
        APOrientation orientationArrow = CurrentActionPoint.GetOrientationVisual(orientation.Id);

        SceneManager.Instance.SetSelectedObject(orientationArrow.gameObject);
        orientationArrow.SendMessage("Select", false);
    }
 private void OnActionPointOrientationUpdated(object sender, ActionPointOrientationEventArgs args)
 {
     if (!gameObject.activeInHierarchy)
     {
         return;
     }
     if (orientation != null && orientation.Id == args.Data.Id)
     {
         orientation = args.Data;
         UpdateMenu();
     }
 }
Esempio n. 7
0
 public void ActionPointOrientationBaseUpdated(NamedOrientation orientation)
 {
     try {
         ActionPoint actionPoint = ProjectManager.Instance.GetActionPointWithOrientation(orientation.Id);
         actionPoint.BaseUpdateOrientation(orientation);
         OnActionPointUpdated?.Invoke(this, new ActionPointUpdatedEventArgs(actionPoint));
         OnProjectChanged?.Invoke(this, EventArgs.Empty);
     } catch (KeyNotFoundException ex) {
         Debug.LogError(ex);
         Notifications.Instance.ShowNotification("Failed to update action point orientation", ex.Message);
         return;
     }
 }
Esempio n. 8
0
        public virtual void UpdateOrientation(NamedOrientation orientation)
        {
            NamedOrientation originalOrientation = GetOrientation(orientation.Id);

            originalOrientation.Orientation = orientation.Orientation;
            try {
                APOrientation orientationArrow = GetOrientationVisual(orientation.Id);
                orientationArrow.SetOrientation(orientation.Orientation);
            } catch (KeyNotFoundException) {
                AddNewOrientationVisual(orientation);
            }
            BaseUpdateOrientation(originalOrientation, orientation);
        }
Esempio n. 9
0
 public void ActionPointOrientationAdded(NamedOrientation orientation, string actionPointIt)
 {
     try {
         ActionPoint actionPoint = GetActionPoint(actionPointIt);
         actionPoint.AddOrientation(orientation);
         OnActionPointUpdated?.Invoke(this, new ActionPointUpdatedEventArgs(actionPoint));
         OnProjectChanged?.Invoke(this, EventArgs.Empty);
     } catch (KeyNotFoundException ex) {
         Debug.LogError(ex);
         Notifications.Instance.ShowNotification("Failed to add action point orientation", ex.Message);
         return;
     }
 }
    public async void ShowMenu(Base.ActionPoint currentActionPoint, NamedOrientation orientation)
    {
        CurrentActionPoint = currentActionPoint;
        if (!await currentActionPoint.GetOrientationVisual(orientation.Id).WriteLock(false))
        {
            CurrentActionPoint = null;
            return;
        }

        this.orientation         = orientation;
        this.isOrientationDetail = true;

        ShowMenu(currentActionPoint);
    }
Esempio n. 11
0
    public async void OpenDetailMenu(NamedOrientation orientation)
    {
        AddOrientationContainer.SetActive(false);
        AddJointsContainer.SetActive(false);
        if (OrientationJointsDetailMenu.IsVisible())
        {
            OrientationJointsDetailMenu.HideMenu();
        }
        ContainerJoints.SetActive(false);
        ContainerOrientations.SetActive(false);
        ContainerPosition.SetActive(false);
        OrientationJointsDetailMenu.ShowMenu(CurrentActionPoint, orientation);
        APOrientation orientationArrow = CurrentActionPoint.GetOrientationVisual(orientation.Id);

        SceneManager.Instance.SetSelectedObject(orientationArrow.gameObject);
    }
Esempio n. 12
0
    /// <summary>
    /// Creates button in orientations dynamic list with orientation's arrow highlight on hover
    /// </summary>
    /// <param name="orientation"></param>
    private void CreateOrientationBtn(NamedOrientation orientation)
    {
        ActionButton orientationButton = CreateBtn(OrientationsDynamicList.transform, orientation.Id, orientation.Name, () => OpenDetailMenu(orientation));

        // Add EventTrigger OnPointerEnter and OnPointerExit - to be able to highlight corresponding orientation when hovering over button
        OutlineOnClick orientationOutline = CurrentActionPoint.GetOrientationVisual(orientation.Id).GetComponent <OutlineOnClick>();
        EventTrigger   eventTrigger       = orientationButton.gameObject.AddComponent <EventTrigger>();

        // Create OnPointerEnter entry
        EventTrigger.Entry onPointerEnter = new EventTrigger.Entry {
            eventID = EventTriggerType.PointerEnter
        };
        onPointerEnter.callback.AddListener((eventData) => orientationOutline.Highlight());
        eventTrigger.triggers.Add(onPointerEnter);

        // Create OnPointerExit entry
        EventTrigger.Entry onPointerExit = new EventTrigger.Entry {
            eventID = EventTriggerType.PointerExit
        };
        onPointerExit.callback.AddListener((eventData) => orientationOutline.UnHighlight());
        eventTrigger.triggers.Add(onPointerExit);
    }
Esempio n. 13
0
 public void BaseUpdateOrientation(NamedOrientation originalOrientation, NamedOrientation orientation)
 {
     originalOrientation.Name = orientation.Name;
 }
Esempio n. 14
0
 public virtual void AddOrientation(NamedOrientation orientation)
 {
     Data.Orientations.Add(orientation);
     AddNewOrientationVisual(orientation);
 }
Esempio n. 15
0
 public void RemoveOrientation(NamedOrientation orientation)
 {
     Data.Orientations.Remove(orientation);
 }
Esempio n. 16
0
 public void AddOrientation(NamedOrientation orientation)
 {
     Data.Orientations.Add(orientation);
 }
Esempio n. 17
0
 public override void AddOrientation(NamedOrientation orientation)
 {
     base.AddOrientation(orientation);
     UpdateOrientationsVisuals();
 }
 public ActionPointOrientationAddedEventArgs(string actionPointID, NamedOrientation orientation)
 {
     ActionPointID = actionPointID;
     Orientation   = orientation;
 }
Esempio n. 19
0
 public override void AddOrientation(NamedOrientation orientation)
 {
     base.AddOrientation(orientation);
 }
Esempio n. 20
0
 public override void UpdateOrientation(NamedOrientation orientation)
 {
     base.UpdateOrientation(orientation);
 }