Exemplo n.º 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;
        }
Exemplo n.º 2
0
        SetButtonPercentText(this PedalOption pedalOption,
                             string text) //pedalOption.GetActionButton().prop_String_1
        {
            if (actionButtonPercentProperty != null)
            {
                actionButtonPercentProperty.SetValue(pedalOption.GetActionButton(), text);
                return;
            }

            var button = pedalOption.GetActionButton();

            actionButtonPercentProperty = typeof(ActionButton)
                                          .GetProperties(BindingFlags.Public | BindingFlags.Instance).Single(
                p => p.PropertyType == typeof(string) && ((string)p.GetValue(button)).Equals("100%")
                );
            actionButtonPercentProperty.SetValue(pedalOption.GetActionButton(), text);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public static void SetPedalTypeIcon(this PedalOption pedalOption, Texture2D icon)
 {
     pedalOption.GetActionButton().prop_Texture2D_2 = icon; //No choice needs to be hardcoded in sadly
 }
Exemplo n.º 5
0
 public static void Lock(this PedalOption pedalOption)
 {
     pedalOption.prop_Boolean_0 = true;
     ResourcesManager.AddLockChildIcon(pedalOption.GetActionButton().gameObject.GetChild("Inner"));
 }
Exemplo n.º 6
0
 public static void SetBackgroundIcon(this PedalOption pedal, Texture2D icon)
 {
     pedal.GetActionButton().prop_Texture2D_0 = icon;
 }