39 lines
757 B
C#
39 lines
757 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace RogueUtils.Data
|
|
{
|
|
/// <summary>
|
|
/// This is a base class for BaseVariable to allow things to have references
|
|
/// to BaseVariable without knowing their type.
|
|
/// </summary>
|
|
public abstract class SubBaseVariable : ScriptableObject
|
|
{
|
|
private event EventHandler InternalOnChangeUntyped;
|
|
|
|
public event EventHandler OnChangeUntyped
|
|
{
|
|
add
|
|
{
|
|
InternalOnChangeUntyped += value;
|
|
}
|
|
|
|
remove
|
|
{
|
|
InternalOnChangeUntyped -= value;
|
|
}
|
|
}
|
|
|
|
protected void BaseHandleValueChange()
|
|
{
|
|
InternalOnChangeUntyped?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
|
|
public abstract T GetValue<T>();
|
|
|
|
public abstract object GetValueUntyped();
|
|
|
|
public abstract void SetValueUntyped(object value);
|
|
}
|
|
}
|