Created
February 9, 2024 11:09
-
-
Save nekomimi-daimao/d1452a182cc16893071b3d7041b61f2f to your computer and use it in GitHub Desktop.
UnityのInspectorでDictionary的に使う
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Nekomimi.Daimao | |
{ | |
[Serializable] | |
public class SerializableTable<TKey, TValue> | |
{ | |
public SerializableKeyValue<TKey, TValue>[] table; | |
public Dictionary<TKey, TValue> ToDictionary => table.ToDictionary(kv => kv.key, kv => kv.value); | |
} | |
[Serializable] | |
public class SerializableKeyValue<TKey, TValue> | |
{ | |
public TKey key; | |
public TValue value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment