diff --git a/Scriptable Variables/Variables/Base Types/ScriptableVariable.cs b/Scriptable Variables/Variables/Base Types/ScriptableVariable.cs index 59162d2b27577bc032fbc8f94398b623ecb3da68..c497733ed4e8cc6e04a0a25ae691c53f80e29dd4 100644 --- a/Scriptable Variables/Variables/Base Types/ScriptableVariable.cs +++ b/Scriptable Variables/Variables/Base Types/ScriptableVariable.cs @@ -27,9 +27,7 @@ namespace Shared.ScriptableVariables { set { if ((value == null && this.value != null) || (value != null && !value.Equals(this.value))) { this.value = value; - if (OnValueChanged != null) { - OnValueChanged.Invoke(); - } + ValueChanged(); } } } @@ -39,6 +37,13 @@ namespace Shared.ScriptableVariables { Value = defaultValue; } + //--------------------------------------------------------------------------- + protected void ValueChanged() { + if (OnValueChanged != null) { + OnValueChanged.Invoke(); + } + } + #if UNITY_EDITOR //----------------------------------------------------------------------------- //Base class for custom editors which expose the Property of ScriptableVariables diff --git a/package.json b/package.json index ff5154a8df40ba3b47550ef3a113d9d6ac4adef3..80847a34ba725edca64242acbe81503592ff37eb 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.13", + "version": "0.1.14", "unity": "2018.3", "license": "MIT", "repository": {