using System; using System.Collections.Generic; using UnityEngine; namespace ScriptableObjectManager { [Serializable] public class ScriptableObjectDictionary : ScriptableObject { [SerializeField] [HideInInspector] private List keys = new List(); [SerializeField] public List values = new List(); protected Dictionary target; public Dictionary Target { get { int size = keys.Count; if (null == target || 0 == target.Count) { target = new Dictionary(); for (int i = 0; i < size; i++) target.Add(keys[i], values[i]); } return target; } set { target = value; keys = new List(target.Keys); values = new List(target.Values); } } } }