31 lines
687 B
C#
31 lines
687 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
namespace BITKit
|
|
{
|
|
|
|
[System.Serializable]
|
|
public record DataReference : References
|
|
{
|
|
[SubclassSelector, SerializeReference] public References value;
|
|
public override string Get()
|
|
{
|
|
return Data.Get<string>(value) ?? value;
|
|
}
|
|
}
|
|
[System.Serializable]
|
|
public record DataReference<T> : References<T>
|
|
{
|
|
public DataReference(string key)
|
|
{
|
|
this.key = key;
|
|
}
|
|
public readonly string key;
|
|
public override T Get()
|
|
{
|
|
return Data.Get<T>(key);
|
|
}
|
|
}
|
|
}
|