BITFALL/Assets/BITKit/Unity/Scripts/Reference/DictionaryReference.cs

30 lines
634 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UIElements;
namespace BITKit
{
[Serializable]
public struct DictionaryReference : IReference
{
[SerializeField] private int index;
#if UNITY_EDITOR
[SerializeField,HideInInspector] private string keyword;
#endif
public string Get()
{
if (DictionaryReferenceScriptableObject.Dictionary.TryGetValue(index, out var value))
{
return value;
}
return "Not Found";
}
}
}