namespace UnityAtoms { public abstract class ScriptableObjectReference where E1 : GameEvent where E2 : GameEvent where V : ScriptableObjectVariable { public bool UseConstant; public T ConstantValue; public V Variable; protected ScriptableObjectReference() { UseConstant = true; } protected ScriptableObjectReference(T value) : this() { ConstantValue = value; } public T Value { get { return UseConstant ? ConstantValue : Variable.Value; } } public static implicit operator T(ScriptableObjectReference reference) { return reference.Value; } } }