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); }
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); }