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

Apparently events can't be fired from inherited classes, so the...

Apparently events can't be fired from inherited classes, so the ScriptableVariable base class now has a protected function to fire its OnValueChanged event.
parent 1dc17826
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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": {
......
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