1
This commit is contained in:
23
Unity/Scripts/NameProvider/GetNameFromIDatabase.cs
Normal file
23
Unity/Scripts/NameProvider/GetNameFromIDatabase.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user