Files
BITKit/Unity/Scripts/NameProvider/GetNameFromIDatabase.cs
CortexCore 4565ff2e35 1
2023-06-05 16:25:06 +08:00

23 lines
619 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
[System.Serializable]
public class GetNameFromIDatabase : NameProvider
{
[SerializeReference, SubclassSelector] public References path;
public Object Object;
public override string GetName(object obj, params object[] extensions)
{
if (Object is IDatabase database)
{
return database.Get<string>(path);
}
else
{
throw new System.NullReferenceException();
}
}
}
}