Skip to content
Snippets Groups Projects
Commit bb244130 authored by Heine, Eric R's avatar Heine, Eric R
Browse files

Gave the int variable input the same treatment as the float one so you can...

Gave the int variable input the same treatment as the float one so you can delete it all back to 0 if you'd like.
parent 7006e233
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,12 @@ namespace Shared.SEUI { ...@@ -27,7 +27,12 @@ namespace Shared.SEUI {
protected override void AddUIListener(UnityAction<int> callback) { protected override void AddUIListener(UnityAction<int> callback) {
// Define the value converting bridge callback to add to the UI listener // Define the value converting bridge callback to add to the UI listener
valueConverter = delegate(string value) { valueConverter = delegate(string value) {
callback(Convert.ToInt32(value)); if (!String.IsNullOrEmpty(input.text)) {
callback(Convert.ToInt32(value));
}
else {
callback(0);
}
}; };
input.onValueChanged.AddListener(valueConverter); input.onValueChanged.AddListener(valueConverter);
...@@ -43,12 +48,12 @@ namespace Shared.SEUI { ...@@ -43,12 +48,12 @@ namespace Shared.SEUI {
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
protected override bool DoValuesMatch() { protected override bool DoValuesMatch() {
return input.text == variable.Value.ToString(); return !String.IsNullOrEmpty(input.text) && input.text == variable.Value.ToString();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
protected override void UpdateUIValue() { protected override void UpdateUIValue() {
input.text = variable.Value.ToString(); input.SetTextWithoutNotify(variable.Value.ToString());
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "com.futuretech.shared", "name": "com.futuretech.shared",
"displayName": "FutureTech Shared", "displayName": "FutureTech Shared",
"description": "Contains shared items such as the Scriptable Variables.", "description": "Contains shared items such as the Scriptable Variables.",
"version": "0.1.16", "version": "0.1.17",
"unity": "2018.3", "unity": "2018.3",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment