Files
SampleRenderPasses/Assets/SubBaseVariable.cs
2025-05-18 22:39:39 +03:00

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);
}
}