public void UpdateOrientation(NamedOrientation orientation) { NamedOrientation originalOrientation = GetOrientation(orientation.Id); originalOrientation.Orientation = orientation.Orientation; BaseUpdateOrientation(originalOrientation, orientation); }
public void ShowMenu(Base.ActionPoint currentActionPoint, NamedOrientation orientation) { this.orientation = orientation; this.isOrientationDetail = true; ShowMenu(currentActionPoint); }
private void OnActionPointOrientationUpdated(object sender, ActionPointOrientationEventArgs args) { if (orientation != null && orientation.Id == args.Data.Id) { orientation = args.Data; UpdateMenu(); } }
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(); } }
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; } }
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); }
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); }
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); }
/// <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); }
public void BaseUpdateOrientation(NamedOrientation originalOrientation, NamedOrientation orientation) { originalOrientation.Name = orientation.Name; }
public virtual void AddOrientation(NamedOrientation orientation) { Data.Orientations.Add(orientation); AddNewOrientationVisual(orientation); }
public void RemoveOrientation(NamedOrientation orientation) { Data.Orientations.Remove(orientation); }
public void AddOrientation(NamedOrientation orientation) { Data.Orientations.Add(orientation); }
public override void AddOrientation(NamedOrientation orientation) { base.AddOrientation(orientation); UpdateOrientationsVisuals(); }
public ActionPointOrientationAddedEventArgs(string actionPointID, NamedOrientation orientation) { ActionPointID = actionPointID; Orientation = orientation; }
public override void AddOrientation(NamedOrientation orientation) { base.AddOrientation(orientation); }
public override void UpdateOrientation(NamedOrientation orientation) { base.UpdateOrientation(orientation); }