public override void Init() { try { TitleUITextField(); color = new JSONStorableColor("Color", HSVColorPicker.RGBToHSV(1f, 1f, 1f), _ => SyncMats()); RegisterColor(color); CreateColorPicker(color, true); FloatSlider(ref alpha, "Color Alpha", 1, _ => { SyncMats(); }, 0, 2, true); renderOriginal = new JSONStorableBool("Render Original Material", true); RegisterBool(renderOriginal); CreateToggle(renderOriginal, false); mode = new JSONStorableBool("Mode", true, (bool _) => SyncMats()); CreateToggle(mode, false); RegisterUrl(loadedShaderPath); CreateButton("Rescan active clothes").button.onClick.AddListener(() => { StartCoroutine(Rebuild()); }); } catch (Exception e) { Log.Error($"{e}"); } }
protected void SetSubdermisColor(JSONStorableColor jcolor) { foreach (Material vamMaterial in vamMaterials.SelectMany(x => x).Where(x => x != null)) { vamMaterial.SetColor("_SubdermisColor", jcolor.colorPicker.currentColor); } }
protected void DummyColorCallback(JSONStorableColor jcolor) { if (dbutton != null) { dbutton.buttonColor = jcolor.colorPicker.currentColor; } }
protected void SetTextColor(JSONStorableColor jcolor) { textColor = jcolor.colorPicker.currentColor; StyleLabel(labelTopLeft); StyleLabel(labelTopRight); StyleLabel(labelBottomLeft); StyleLabel(labelBottomRight); }
protected void SetDiffColor(JSONStorableColor jcolor) { foreach (Material vamMaterial in vamMaterials.SelectMany(x => x).Where(x => x != null)) { SuperController.LogMessage($"Setcolor {vamMaterial} from {vamMaterial.GetColor("_Color")} to {jcolor.colorPicker.currentColor}"); vamMaterial.SetColor("_Color", jcolor.colorPicker.currentColor); } }
protected void BuildUIControls() { //Diff Color HSVColor diffColorHSVC = HSVColorPicker.RGBToHSV(1f, 1f, 1f); jDiffColor = new JSONStorableColor("DiffuseColor", diffColorHSVC, SetDiffColor); RegisterColor(jDiffColor); CreateColorPicker(jDiffColor, true); //Specular Color HSVColor specColorHSVC = HSVColorPicker.RGBToHSV(1f, 1f, 1f); jSpecColor = new JSONStorableColor("SpecularColor", specColorHSVC, SetSpecColor); RegisterColor(jSpecColor); CreateColorPicker(jSpecColor, true); // Specular Intensity jSpecIntensityFloat = new JSONStorableFloat("SpecularIntensity", 0.5f, SetSpecIntensity, 0f, 1f, true); RegisterFloat(jSpecIntensityFloat); specIntensitySlider = CreateSlider(jSpecIntensityFloat); // Specular Sharpness jSpecSharpnessFloat = new JSONStorableFloat("SpecularSharpness", 6f, SetSpecSharpness, 0f, 10f, true); RegisterFloat(jSpecSharpnessFloat); specSharpnessSlider = CreateSlider(jSpecSharpnessFloat); // Specular Fresnel jSpecFresnelFloat = new JSONStorableFloat("SpecularFresnel", 0f, SetSpecFresnel, 0f, 1f, true); RegisterFloat(jSpecFresnelFloat); specFresnelSlider = CreateSlider(jSpecFresnelFloat); // Diffuse Offset jDiffOffsetFloat = new JSONStorableFloat("DiffuseOffset", 0f, SetDiffOffset, -1f, 1f, true); RegisterFloat(jDiffOffsetFloat); diffOffsetSlider = CreateSlider(jDiffOffsetFloat); // Spec Offset jSpecOffsetFloat = new JSONStorableFloat("SpecularOffset", 0f, SetSpecOffset, -1f, 1f, true); RegisterFloat(jSpecOffsetFloat); specOffsetSlider = CreateSlider(jSpecOffsetFloat); // Gloss Offset jGlossOffsetFloat = new JSONStorableFloat("GlossOffset", 0.8f, SetGlossOffset, 0, 1f, true); RegisterFloat(jGlossOffsetFloat); glossOffsetSlider = CreateSlider(jGlossOffsetFloat); // IBL Filter (affects Global Illum Skybox ?!) jIBLFilterFloat = new JSONStorableFloat("IBLFilter", 0f, SetIBLFilter, 0, 1f, true); RegisterFloat(jIBLFilterFloat); iBLFilterSlider = CreateSlider(jIBLFilterFloat); //Subdermis Color HSVColor subdermisColorHSVC = HSVColorPicker.RGBToHSV(1f, 1f, 1f); jSubdermisColor = new JSONStorableColor("SubdermisColor", subdermisColorHSVC, SetSubdermisColor); RegisterColor(jSubdermisColor); CreateColorPicker(jSubdermisColor, true); }
protected void SetupPluginUI() { List <string> choices = new List <string>(); choices.Add("None"); choices.Add("FPS"); choices.Add("Load Dir"); choices.Add("Total Atoms"); JSONStorableStringChooser jsonTypeTopLeft = new JSONStorableStringChooser("TopLeft", choices, typeTopLeft, "Top Left", SetTopLeft); UIDynamicPopup dropdownTopLeft = CreatePopup(jsonTypeTopLeft); dropdownTopLeft.labelWidth = 300f; JSONStorableStringChooser jsonTypeTopRight = new JSONStorableStringChooser("TopRight", choices, typeTopRight, "Top Right", SetTopRight); UIDynamicPopup dropdownTopRight = CreatePopup(jsonTypeTopRight, true); dropdownTopRight.labelWidth = 300f; JSONStorableStringChooser jsonTypeBottomLeft = new JSONStorableStringChooser("BottomLeft", choices, typeBottomLeft, "Bottom Left", SetBottomLeft); UIDynamicPopup dropdownBottomLeft = CreatePopup(jsonTypeBottomLeft); dropdownBottomLeft.labelWidth = 300f; JSONStorableStringChooser jsonTypeBottomRight = new JSONStorableStringChooser("BottomRight", choices, typeBottomRight, "Bottom Right", SetBottomRight); UIDynamicPopup dropdownBottomRight = CreatePopup(jsonTypeBottomRight, true); dropdownBottomRight.labelWidth = 300f; // let user adjust scale and top for HMD viewport differences and personal preference. JSONStorableFloat jsonTopOffset = new JSONStorableFloat("Top Offset", topOffset, SetTopOffset, -2f, +2f, true); RegisterFloat(jsonTopOffset); sliderTopOffset = CreateSlider(jsonTopOffset); JSONStorableFloat jsonScale = new JSONStorableFloat("HUD Scale", hudScale, SetScale, 10f, 200f, true); RegisterFloat(jsonScale); sliderScale = CreateSlider(jsonScale); JSONStorableFloat jsonFontSize = new JSONStorableFloat("Text Size", fontSize, SetFontSize, 10f, 100f, true); RegisterFloat(jsonFontSize); sliderFontSize = CreateSlider(jsonFontSize); // JSONStorableColor example HSVColor hsvc = HSVColorPicker.RGBToHSV(textColor.r, textColor.g, textColor.b); JSONStorableColor jsonTextColor = new JSONStorableColor("Text Color", hsvc, SetTextColor); RegisterColor(jsonTextColor); CreateColorPicker(jsonTextColor, true); }
private void ColorPicker(List <Material> mat, string shaderParamName, string displayname = null) { if (displayname == null) { displayname = shaderParamName; } var picker = new JSONStorableColor(displayname, HSVColorPicker.RGBToHSV(1f, 1f, 1f), c => mat.ForEach(m => m.SetColor(shaderParamName, c.colorPicker.currentColor)) ); script.RegisterColor(picker); script.CreateColorPicker(picker, true); }
public override void Init() { try { color = new JSONStorableColor("Color", HSVColorPicker.RGBToHSV(1f, 1f, 1f), _ => SyncMats()); RegisterColor(color); CreateColorPicker(color, true); FloatSlider(ref alpha, "Color Alpha", 1, _ => { SyncMats(); }, 0, 1, true); renderOriginal = new JSONStorableBool("Render Original Material", true); RegisterBool(renderOriginal); CreateToggle(renderOriginal, false); RegisterUrl(loadedShaderPath); CreateButton("Rescan active clothes").button.onClick.AddListener(() => { StartCoroutine(Rebuild()); }); StartCoroutine(LoadShaderAndInit()); } catch (Exception e) { SuperController.LogError("Exception caught: " + e); } }
public override void Init() { try { radius = new JSONStorableFloat("radius", 2, (float count) => { SetupLights(); }, 0, 10, false); RegisterFloat(radius); CreateSlider(radius); count = new JSONStorableFloat("count", 4, (float count) => { ClearLights(); StartCoroutine(GenerateLights()); }, 1, 20); RegisterFloat(count); CreateSlider(count); forcePixel = new JSONStorableBool("force pixel lights", true, (bool force) => { SetupLights(); }); RegisterBool(forcePixel); CreateToggle(forcePixel); lightType = new JSONStorableStringChooser("light type", new List <string> { "Point", "Spot" }, "Spot", "light type", (string type) => { SetupLights(); }); RegisterStringChooser(lightType); CreatePopup(lightType); lookAt = new JSONStorableBool("look at", true); RegisterBool(lookAt); CreateToggle(lookAt); heightOffset = new JSONStorableFloat("height offset", 0, (float offset) => { SetupLights(); }, -4, 4, false); RegisterFloat(heightOffset); CreateSlider(heightOffset); sharedIntensity = new JSONStorableFloat("shared intensity", 1.8f, (float intensity) => { SetupLights(); }, 0, 10, false); RegisterFloat(sharedIntensity); CreateSlider(sharedIntensity); sharedRange = new JSONStorableFloat("shared range", 5, (float intensity) => { SetupLights(); }, 0, 25, false); RegisterFloat(sharedRange); CreateSlider(sharedRange); sharedSpotAngle = new JSONStorableFloat("shared spot angle", 80, (float intensity) => { SetupLights(); }, 1, 180, false); RegisterFloat(sharedSpotAngle); CreateSlider(sharedSpotAngle); intensityCurveStart = new JSONStorableFloat("intensity curve start", 1, (float intensity) => { SetupLights(); }, 0, 4, false); RegisterFloat(intensityCurveStart); CreateSlider(intensityCurveStart, true); intensityCurveMid = new JSONStorableFloat("intensity curve mid", 1, (float intensity) => { SetupLights(); }, 0, 4, false); RegisterFloat(intensityCurveMid); CreateSlider(intensityCurveMid, true); intensityCurveEnd = new JSONStorableFloat("intensity curve end", 1, (float intensity) => { SetupLights(); }, 0, 4, false); RegisterFloat(intensityCurveEnd); CreateSlider(intensityCurveEnd, true); intensityMidPoint = new JSONStorableFloat("intensity midPoint", 0.5f, (float intensity) => { SetupLights(); }, 0, 1, false); RegisterFloat(intensityMidPoint); CreateSlider(intensityMidPoint, true); Color defaultRGB = new Color(1, 0.8941176470588235f, 0.7803921568627451f); float h, s, v = 0; Color.RGBToHSV(defaultRGB, out h, out s, out v); HSVColor startingColor = new HSVColor { H = h, S = s, V = v }; colorStart = new JSONStorableColor("color start", startingColor, (float ch, float cs, float cv) => { SetupLights(); }); RegisterColor(colorStart); CreateColorPicker(colorStart, true); colorEnd = new JSONStorableColor("color end", startingColor, (float ch, float cs, float cv) => { SetupLights(); }); RegisterColor(colorEnd); CreateColorPicker(colorEnd, true); StartCoroutine(GenerateLights()); } catch (Exception e) { SuperController.LogError("Exception caught: " + e); } }
private void InitStorables() { ////////////////////////////////////// // UI related // Cup algorithm choice showFeatureMarkersStorable = new JSONStorableBool("Auto Feature Guides", true, (bool value) => { showFeatureMarkersStorable.valNoCallback = value; Draw(); }); showFeatureMarkersStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterBool(showFeatureMarkersStorable); lineThicknessFigureStorable = new JSONStorableFloat("Feature Guide Line Width", 2, 1, 10, constrain: true); lineThicknessFigureStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(lineThicknessFigureStorable); featureMarkerColor = new JSONStorableColor("Feature Guide Color", _plugin.ColorToHSV(Color.green), (float h, float s, float v) => { var hsv = new HSVColor { H = h, S = s, V = v }; featureMarkerColor.valNoCallback = hsv; if (_featureMarkerColorButton != null) { _featureMarkerColorButton.buttonColor = _plugin.HSVToColor(hsv); } }); featureMarkerColor.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterColor(featureMarkerColor); showFeatureMarkerLabelsStorable = new JSONStorableBool("Feature Guide Labels", true, (bool value) => { Draw(); }); showFeatureMarkerLabelsStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterBool(showFeatureMarkerLabelsStorable); ////////////////// showHeadHeightMarkersStorable = new JSONStorableBool("Auto Head Heights Guides", true, (bool value) => { showHeadHeightMarkersStorable.valNoCallback = value; Draw(); }); showHeadHeightMarkersStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterBool(showHeadHeightMarkersStorable); lineThicknessHeadStorable = new JSONStorableFloat("Head Heights Line Width", 2, 1, 10, constrain: true); lineThicknessHeadStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(lineThicknessHeadStorable); headMarkerColor = new JSONStorableColor("Head Guide Color", _plugin.ColorToHSV(Color.white), (float h, float s, float v) => { var hsv = new HSVColor { H = h, S = s, V = v }; headMarkerColor.valNoCallback = hsv; if (_headMarkerColorButton != null) { _headMarkerColorButton.buttonColor = _plugin.HSVToColor(hsv); } }); headMarkerColor.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterColor(headMarkerColor); ////////////////// showFaceMarkersStorable = new JSONStorableBool("Auto Face Guides", true, (bool value) => { Draw(); }); showFaceMarkersStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterBool(showFaceMarkersStorable); lineThicknessFaceStorable = new JSONStorableFloat("Face Line Width", 2, 1, 10, constrain: true); lineThicknessFaceStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(lineThicknessFaceStorable); faceMarkerColor = new JSONStorableColor("Face Guide Color", _plugin.ColorToHSV(Color.blue), (float h, float s, float v) => { var hsv = new HSVColor { H = h, S = s, V = v }; faceMarkerColor.valNoCallback = hsv; if (_faceMarkerColorButton != null) { _faceMarkerColorButton.buttonColor = _plugin.HSVToColor(hsv); } }); faceMarkerColor.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterColor(faceMarkerColor); ////////////////// showCircumferenceMarkersStorable = new JSONStorableBool("Auto Circumference Guides", false, (bool value) => { showCircumferenceMarkersStorable.valNoCallback = value; Draw(); }); showCircumferenceMarkersStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterBool(showCircumferenceMarkersStorable); lineThicknessCircumferenceStorable = new JSONStorableFloat("Circumference Guide Line Width", 2, 1, 10, constrain: true); lineThicknessCircumferenceStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(lineThicknessCircumferenceStorable); circumferenceMarkerColor = new JSONStorableColor("Circumference Guide Color", _plugin.ColorToHSV(Color.green), (float h, float s, float v) => { var hsv = new HSVColor { H = h, S = s, V = v }; circumferenceMarkerColor.valNoCallback = hsv; if (_circumferenceMarkerColorButton != null) { _circumferenceMarkerColorButton.buttonColor = _plugin.HSVToColor(hsv); } }); circumferenceMarkerColor.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterColor(circumferenceMarkerColor); ////////////////// // Choose cupAlgorithmStorable = new JSONStorableStringChooser( "Cup Size Method", _cupCalculators.Select(cc => cc.Name).ToList(), _cupCalculators[0].Name, "Cup Size Method" ); cupAlgorithmStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterStringChooser(cupAlgorithmStorable); unitsStorable = new JSONStorableStringChooser( "Units", new List <string> { UnitUtils.US, UnitUtils.Metric, UnitUtils.Meters, UnitUtils.Centimeters, UnitUtils.Inches, UnitUtils.Feet, UnitUtils.Heads }, new List <string> { "US (in / ft)", "Metric (cm / m)", "Meters (m)", "Centimeters (cm)", "Inches (in)", "Feet (ft)", "Heads (head.unit.)" }, UnitUtils.Centimeters, "Units" ); unitsStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterStringChooser(unitsStorable); // Float: How far apart markers are spread apart markerSpreadStorable = new JSONStorableFloat("Spread Guides", 0.02f, -1, 1); markerSpreadStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(markerSpreadStorable); // Float: Move markers forward or backward relative to center depth of the head markerFrontBackStorable = new JSONStorableFloat("Move Guides Forward/Backward", 0.15f, -5, 5); markerFrontBackStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(markerFrontBackStorable); // Float: Move markers left or right markerLeftRightStorable = new JSONStorableFloat("Move Guides Left/Right", 0, -5, 5); markerLeftRightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(markerLeftRightStorable); // Float: Move markers forward or backward relative to center depth of the head markerUpDownStorable = new JSONStorableFloat("Move Guides Up/Down", 0, -5, 5); markerUpDownStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(markerUpDownStorable); ////////////////////////////////////// // calculated positions and distances for other _plugins to use if wanted fullHeightStorable = new JSONStorableFloat("figureHeight", 0, 0, 100); fullHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(fullHeightStorable); heightInHeadsStorable = new JSONStorableFloat("figureHeightHeads", 0, 0, 100); heightInHeadsStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(heightInHeadsStorable); headSizeHeightStorable = new JSONStorableFloat("headSizeHeight", 0, 0, 100); headSizeHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(headSizeHeightStorable); chinHeightStorable = new JSONStorableFloat("chinHeight", 0, 0, 100); chinHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(chinHeightStorable); shoulderHeightStorable = new JSONStorableFloat("shoulderHeight", 0, 0, 100); shoulderHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(shoulderHeightStorable); nippleHeightStorable = new JSONStorableFloat("nippleHeight", 0, 0, 100); nippleHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(nippleHeightStorable); underbustHeightStorable = new JSONStorableFloat("underbustHeight", 0, 0, 100); underbustHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(underbustHeightStorable); navelHeightStorable = new JSONStorableFloat("navelHeight", 0, 0, 100); navelHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(navelHeightStorable); crotchHeightStorable = new JSONStorableFloat("crotchHeight", 0, 0, 100); crotchHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(crotchHeightStorable); kneeBottomHeightStorable = new JSONStorableFloat("kneeHeight", 0, 0, 100); kneeBottomHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(kneeBottomHeightStorable); headSizeWidthStorable = new JSONStorableFloat("headSizeWidth", 0, 0, 100); headSizeWidthStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(headSizeWidthStorable); breastBustStorable = new JSONStorableFloat("breastBustSize", 0, 0, 100); breastBustStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(breastBustStorable); breastUnderbustStorable = new JSONStorableFloat("breastUnderbustSize", 0, 0, 100); breastUnderbustStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(breastUnderbustStorable); breastBandStorable = new JSONStorableFloat("breastBandSize", 0, 0, 100); breastBandStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(breastBandStorable); breastCupStorable = new JSONStorableString("breastCupSize", ""); breastCupStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterString(breastCupStorable); waistSizeStorable = new JSONStorableFloat("waistSize", 0, 0, 100); waistSizeStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(waistSizeStorable); hipSizeStorable = new JSONStorableFloat("hipSize", 0, 0, 100); hipSizeStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(hipSizeStorable); penisLength = new JSONStorableFloat("penisLength", 0, 0, 100); penisLength.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(penisLength); penisWidth = new JSONStorableFloat("penisWidth", 0, 0, 100); penisWidth.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(penisWidth); penisGirth = new JSONStorableFloat("penisGirth", 0, 0, 100); penisGirth.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(penisGirth); // manual heights showManualMarkersStorable = new JSONStorableBool("Manual Markers", false, (bool value) => { showManualMarkersStorable.valNoCallback = value; Draw(); }); showManualMarkersStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterBool(showManualMarkersStorable); manualMarkersCopy = new JSONStorableBool("Copy Markers From Person", false); manualMarkersCopy.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterBool(manualMarkersCopy); lineThicknessManualStorable = new JSONStorableFloat("Manual Guide Line Width", 2, 1, 10, constrain: true); lineThicknessManualStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(lineThicknessManualStorable); manualMarkerColor = new JSONStorableColor("Manual Guide Color", _plugin.ColorToHSV(Color.yellow), (float h, float s, float v) => { var hsv = new HSVColor { H = h, S = s, V = v }; manualMarkerColor.valNoCallback = hsv; if (_manualMarkerColorButton != null) { _manualMarkerColorButton.buttonColor = _plugin.HSVToColor(hsv); } }); manualMarkerColor.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterColor(manualMarkerColor); manualHeightStorable = new JSONStorableFloat("Height", 0, 0, 300); manualHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(manualHeightStorable); manualChinHeightStorable = new JSONStorableFloat("Chin Height", 0, 0, 300); manualChinHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(manualChinHeightStorable); manualShoulderHeightStorable = new JSONStorableFloat("Shoulder Height", 0, 0, 300); manualShoulderHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(manualShoulderHeightStorable); manualNippleHeightStorable = new JSONStorableFloat("Bust Height", 0, 0, 300); manualNippleHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(manualNippleHeightStorable); manualUnderbustHeightStorable = new JSONStorableFloat("Underbust Height", 0, 0, 300); manualUnderbustHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(manualUnderbustHeightStorable); manualNavelHeightStorable = new JSONStorableFloat("Navel Height", 0, 0, 300); manualNavelHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(manualNavelHeightStorable); manualCrotchHeightStorable = new JSONStorableFloat("Crotch Height", 0, 0, 300); manualCrotchHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(manualCrotchHeightStorable); manualKneeBottomHeightStorable = new JSONStorableFloat("Knee Height", 0, 0, 300); manualKneeBottomHeightStorable.storeType = JSONStorableParam.StoreType.Full; _plugin.RegisterFloat(manualKneeBottomHeightStorable); }
// IMPORTANT - DO NOT make custom enums. The dynamic C# complier crashes Unity when it encounters these for // some reason // IMPORTANT - DO NOT OVERRIDE Awake() as it is used internally by MVRScript - instead use Init() function which // is called right after creation public override void Init() { try { // put init code in here SuperController.LogMessage("Template Loaded"); // create custom JSON storable params here if you want them to be stored with scene JSON // types are JSONStorableFloat, JSONStorableBool, JSONStorableString, JSONStorableStringChooser // JSONStorableColor // JSONStorableFloat example JSONStorableFloat jfloat = new JSONStorableFloat("FooParam", 0f, DummyFloatCallback, 0f, 5f, true); RegisterFloat(jfloat); dslider = CreateSlider(jfloat); // button example dbutton = CreateButton("FooButton"); if (dbutton != null) { dbutton.button.onClick.AddListener(DummyButtonCallback); } // JSONStorableColor example HSVColor hsvc = HSVColorPicker.RGBToHSV(1f, 0f, 0f); JSONStorableColor jcolor = new JSONStorableColor("FooColor", hsvc, DummyColorCallback); RegisterColor(jcolor); CreateColorPicker(jcolor); // JSONStorableString example jstring = new JSONStorableString("FooString", ""); // register tells engine you want value saved in json file during save and also make it available to // animation/trigger system //RegisterString(jstring); dtext = CreateTextField(jstring); // JSONStorableStringChooser example List <string> choices = new List <string>(); choices.Add("None"); choices.Add("Choice1"); choices.Add("Choice2"); choices.Add("Choice3"); JSONStorableStringChooser jchooser = new JSONStorableStringChooser("FooChooser", choices, "None", "Choose Form Of Destruction", DummyChooserCallback); UIDynamicPopup udp = CreatePopup(jchooser, true); //CreateScrollablePopup(jchooser, true); udp.labelWidth = 300f; JSONStorableFloat jfloat2 = new JSONStorableFloat("FooParam2", 0f, 0f, 1f); CreateSlider(jfloat2, true); // spacer example UIDynamic spacer = CreateSpacer(true); // give the popup some room spacer.height = 400f; // JSONStorableToggle example JSONStorableBool jbool = new JSONStorableBool("FooBool", true); CreateToggle(jbool, true); } catch (Exception e) { SuperController.LogError("Exception caught: " + e); } }