diff --git a/Sane Eric's UI/Scriptable Variables/FloatVariableInput.cs b/Sane Eric's UI/Scriptable Variables/FloatVariableInput.cs index 0882dffa42f61fd6e6f10c13f73f45d9b1b30e9a..53e01124642b528794e540b0dd39a2d06dc55dd9 100644 --- a/Sane Eric's UI/Scriptable Variables/FloatVariableInput.cs +++ b/Sane Eric's UI/Scriptable Variables/FloatVariableInput.cs @@ -27,7 +27,12 @@ namespace Shared.SEUI { protected override void AddUIListener(UnityAction<float> callback) { // Define the value converting bridge callback to add to the UI listener valueConverter = delegate(string value) { - callback(Convert.ToSingle(value)); + if (!String.IsNullOrEmpty(input.text)) { + callback(Convert.ToSingle(value)); + } + else { + callback(0.0f); + } }; input.onValueChanged.AddListener(valueConverter); @@ -43,12 +48,12 @@ namespace Shared.SEUI { //--------------------------------------------------------------------------- protected override bool DoValuesMatch() { - return input.text == variable.Value.ToString(); + return !String.IsNullOrEmpty(input.text) && Convert.ToSingle(input.text) == variable.Value; } //--------------------------------------------------------------------------- protected override void UpdateUIValue() { - input.text = variable.Value.ToString(); + input.SetTextWithoutNotify(variable.Value.ToString()); } //--------------------------------------------------------------------------- diff --git a/package.json b/package.json index 80847a34ba725edca64242acbe81503592ff37eb..b9f68ddc324e2a42614eb3d619029cbe7506dd72 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.futuretech.shared", "displayName": "FutureTech Shared", "description": "Contains shared items such as the Scriptable Variables.", - "version": "0.1.14", + "version": "0.1.15", "unity": "2018.3", "license": "MIT", "repository": {