private void OnHoverItem(PointerEventData eventData, RightClickRadialButton button)
        {
            var index = button.Index;

            if (eventData.dragging || index > Items.Count)
            {
                return;
            }

            var item = Items[index];

            ItemRadial.ChangeLabel(item.Label);
            var itemRadialPosition = ItemRadial.transform.position;
            var actions            = item.SubMenus;

            if (actions == null)
            {
                ActionRadial.SetActive(false);
                radialBranch.UpdateLineSize(ActionRadial, itemRadialPosition);
                return;
            }

            ActionRadial.SetupWithActions(actions);
            ActionRadial.UpdateRotation(index, ItemRadial.ItemArcMeasure);
            radialBranch.UpdateLineSize(ActionRadial, itemRadialPosition);
        }
Exemplo n.º 2
0
        private void OnClickItem(PointerEventData eventData, RightClickRadialButton button)
        {
            var choice = Items[button.Index].gameObject;

            if (choice == null)
            {
                return;
            }
            selectedObject = choice;
            this.SetActive(false);
        }
Exemplo n.º 3
0
        private void OnIndexChanged(RightClickRadialButton button)
        {
            var index = button.Index;

            if (index > Items.Count)
            {
                return;
            }
            var itemInfo = Items[index];

            button.ChangeItem(itemInfo);
        }
Exemplo n.º 4
0
        private void OnHoverItem(PointerEventData eventData, RightClickRadialButton button)
        {
            var index = button.Index;

            if (eventData.dragging || index > Items.Count)
            {
                return;
            }

            var item = Items[index];

            ItemRadial.ChangeLabel(item.Label);
        }
Exemplo n.º 5
0
        private void OnClickAction(PointerEventData eventData, RightClickRadialButton button)
        {
            if (ItemRadial.Selected == null)
            {
                return;
            }

            var itemIndex   = ItemRadial.Selected.Index;
            var actionIndex = button.Index;
            var actionMenu  = Items[itemIndex]?.SubMenus?[actionIndex];

            if (actionMenu == null)
            {
                return;
            }
            actionMenu.Action();
            this.SetActive(actionMenu.keepMenuOpen);
        }
Exemplo n.º 6
0
        private void OnClickItem(PointerEventData eventData, RightClickRadialButton button)
        {
            var subItems = Items[button.Index]?.SubMenus;

            if (subItems == null)
            {
                return;
            }

            // Copern: Not a preferable method of doing this but the original RightClickMenuItem wasn't really
            // designed for this. Also need to switch this to use keybinds.
            if (KeyboardInputManager.IsShiftPressed())
            {
                DoAction(examineOption);
            }
            else if (KeyboardInputManager.IsControlPressed())
            {
                DoAction(pullOption);
            }
            else
            {
                DoAction(pickUpOption);
            }

            void DoAction(RightClickOption option)
            {
                foreach (var item in subItems)
                {
                    if (item.Label != option.label)
                    {
                        continue;
                    }
                    item.Action();
                    this.SetActive(option.keepMenuOpen);
                    return;
                }
            }
        }