public void FloatSlider(ref JSONStorableFloat output, string name, float start, JSONStorableFloat.SetFloatCallback callback, float min, float max, bool right = false, bool constraint = false) { output = new JSONStorableFloat(name, start, callback, min, max, constraint, true) { storeType = JSONStorableParam.StoreType.Full }; script.RegisterFloat(output); script.CreateSlider(output, right); }
public FloatSelector( MVRScript plug, bool insideRestore, CallbackAction call, string startAtom = null, AtomStorableSelector _storableSelected = null) { try { currentValue = new JSONStorableFloat("current value", 0f, setValue, -1f, 1f, false); plug.RegisterFloat(currentValue); currentValueSlider = plug.CreateSlider(currentValue, true); currentValueSlider.gameObject.SetActive(false); this.insideRestore = insideRestore; if (_storableSelected == null) { storableSelected = new AtomStorableSelector(plug, SyncStorable, startAtom); } else { storableSelected = _storableSelected; storableSelected.Add(SyncStorable); } floatChooser = new JSONStorableStringChooser("floatTarget", null, null, "Value", SyncfloatTarget); UIDynamicPopup dp = plug.CreateScrollablePopup(floatChooser); dp.popupPanelHeight = 820f; plug.RegisterStringChooser(floatChooser); } catch (Exception e) { SuperController.LogError("Exception caught: " + e); } }
public static UIDynamic CreateFloatSlider(this MVRScript script, JSONStorableFloat jsf, string label, bool rightSide = true, string valueFormat = "F8") { var control = script.CreateSlider(jsf, rightSide); control.valueFormat = valueFormat; control.label = label; return(control); }
public UIDynamicSlider CreateSlider(JSONStorableFloat jsf, bool rightSide = false) { return(_sliders.AddAndReturn(_plugin.CreateSlider(jsf, rightSide))); }