示例#1
0
        public static void OpenFourAxisMenu(string title, Action <Vector2> update, PedalOption pedalOption)
        {
            if (open)
            {
                return;
            }
            switch (Utilities.GetActionMenuHand())
            {
            case ActionMenuHand.Invalid:
                return;

            case ActionMenuHand.Left:
                current = fourAxisPuppetMenuLeft;
                hand    = ActionMenuHand.Left;
                open    = true;
                break;

            case ActionMenuHand.Right:
                current = fourAxisPuppetMenuRight;
                hand    = ActionMenuHand.Right;
                open    = true;
                break;
            }

            Input.ResetInputAxes();
            onUpdate = update;
            current.gameObject.SetActive(true);
            current.GetTitle().text = title;
            current.transform.localPosition = pedalOption.GetActionButton().transform.localPosition;
        }
        public static void OpenFourAxisMenu(Vector2 startingValue, Action <Vector2> close, string title, Action <Vector2> update)
        {
            if (open)
            {
                return;
            }
            switch (Utilities.GetActionMenuHand())
            {
            case ActionMenuHand.Invalid:
                return;

            case ActionMenuHand.Left:
                current = fourAxisPuppetMenuLeft;
                hand    = ActionMenuHand.Left;
                open    = true;
                break;

            case ActionMenuHand.Right:
                current = fourAxisPuppetMenuRight;
                hand    = ActionMenuHand.Right;
                open    = true;
                break;
            }
            Input.ResetInputAxes();
            onClose  = close;
            onUpdate = update;
            current.gameObject.SetActive(true);
            current.GetTitle().text = title;
            try
            {
                current.Method_Private_Void_Vector2_Boolean_1(startingValue, false);
            }catch {}
            current.transform.localPosition = new Vector3(-256f, 0, 0);
        }
示例#3
0
 public static void CloseRadialMenu()
 {
     current.gameObject.SetActive(false);
     current = null;
     open    = false;
     hand    = ActionMenuHand.Invalid;
     onClose.Invoke(radialPuppetValue);
 }
示例#4
0
 public static void CloseFourAxisMenu()
 {
     if (current == null)
     {
         return;
     }
     CallUpdateAction();
     current.gameObject.SetActive(false);
     current = null;
     open    = false;
     hand    = ActionMenuHand.Invalid;
 }
        public static void OpenRadialMenu(float startingValue, Action <float> onUpdate, string title,
                                          PedalOption pedalOption, bool restricted = false)
        {
            if (open)
            {
                return;
            }
            switch (Utilities.GetActionMenuHand())
            {
            case ActionMenuHand.Invalid:
                return;

            case ActionMenuHand.Left:
                current = radialPuppetMenuLeft;
                hand    = ActionMenuHand.Left;
                open    = true;
                break;

            case ActionMenuHand.Right:
                current = radialPuppetMenuRight;
                hand    = ActionMenuHand.Right;
                open    = true;
                break;
            }

            RadialPuppetManager.restricted = restricted;
            Input.ResetInputAxes();
            current.gameObject.SetActive(true);
            current.GetFill().SetFillAngle(startingValue * 360); //Please dont break
            RadialPuppetManager.onUpdate = onUpdate;
            currentValue = startingValue;
            current.GetTitle().text      = title;
            current.GetCenterText().text = $"{Mathf.Round(startingValue * 100f)}%";
            current.GetFill().UpdateGeometry();
            ;
            current.transform.localPosition =
                pedalOption.GetActionButton().transform.localPosition; //new Vector3(-256f, 0, 0);
            var angleOriginal = Utilities.ConvertFromEuler(startingValue * 360);
            var eulerAngle    = Utilities.ConvertFromDegToEuler(angleOriginal);

            current.UpdateArrow(angleOriginal, eulerAngle);
        }
示例#6
0
        public static void OpenRadialMenu(float startingValue, Action <float> close, string title)
        {
            if (open)
            {
                return;
            }
            switch (Utilities.GetActionMenuHand())
            {
            case ActionMenuHand.Invalid:
                return;

            case ActionMenuHand.Left:
                current = radialPuppetMenuLeft;
                hand    = ActionMenuHand.Left;
                open    = true;
                break;

            case ActionMenuHand.Right:
                current = radialPuppetMenuRight;
                hand    = ActionMenuHand.Right;
                open    = true;
                break;
            }
            Input.ResetInputAxes();
            onClose = close;
            current.gameObject.SetActive(true);
            current.GetFill().field_Public_Single_3 = startingValue;
            onUpdate = onClose;
            current.GetTitle().text      = title;
            current.GetCenterText().text = (Math.Round(radialPuppetMenuRight.GetFill().field_Public_Single_3 / 360 * 100)) + "%";
            current.GetFill().UpdateGeometry();
            current.transform.localPosition = new Vector3(-256f, 0, 0);
            double angleOriginal = (startingValue / 100) * 360;
            double eulerAngle    = Utilities.ConvertFromDegToEuler(angleOriginal);

            current.UpdateArrow(angleOriginal, eulerAngle);
        }