Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 745 Bytes

README.md

File metadata and controls

40 lines (33 loc) · 745 Bytes

Scriptable Dictionary

Provides a base ScriptableObject class ScriptableDictionary<TKey, TValue> that implements IDictionary<TKey, TValue>. You can derive from that class to create custom dictionary asset.

Examples

  1. Simple types
[CreateAssetMenu(fileName = "new Simple Dictionary"]
public class MySimpleDictionary : ScriptableDictionary<string, float>
{
    //
}
  1. Custom Types
public enum SpellType
{
    Air,
    Water,
    Fire,
    Earth
}

[System.Serializable]
public struct DamageInfo
{
    public float value;
    public string name;
    public float knockback;
}

[CreateAssetMenu(fileName = "new Spell Damage Map"]
public class SpellDamageMap : ScriptableDictionary<SpellType, DamageInfo>
{
    //
}