Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);
    }
Exemplo n.º 4
0
 public UIDynamicSlider CreateSlider(JSONStorableFloat jsf, bool rightSide = false)
 {
     return(_sliders.AddAndReturn(_plugin.CreateSlider(jsf, rightSide)));
 }