HKI Core
HKIVar.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Xml;
3 
4 namespace HKI.Core.Variables
5 {
11  [System.Serializable]
12  public abstract class HKIVar : ScriptableObject, ISaveAndLoadable
13  {
14  // Public varaiables
15  public event System.Action OnValueChanged;
16 
17  // Interface functions
18  public abstract void Save(XmlNode parentNode);
19  public abstract void Load(XmlNode node);
20 
21  // Protected helper functions
22  protected void RaiseOnValueChangedCallback()
23  {
24  if(OnValueChanged != null)
25  OnValueChanged.Invoke();
26  }
27  }
28 }
System.Action OnValueChanged
Definition: HKIVar.cs:15
This abstract class of a ScriptableObject is provides child classes with on value changed callback ca...
Definition: HKIVar.cs:12
Interface for saving and loading. This should be used for every class that needs saving.
void RaiseOnValueChangedCallback()
Definition: HKIVar.cs:22