You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

41 lines
877 B

  1. using System;
  2. using UnityEngine;
  3. namespace CIG
  4. {
  5. public abstract class DictionaryAssetCollection<TSerializable, TKey, TValue, TSelf> : AssetCollection<TSerializable, TKey, TValue, TSelf> where TSerializable : DictionaryAssetCollection<TSerializable, TKey, TValue, TSelf>.SerializableDictionary where TSelf : DictionaryAssetCollection<TSerializable, TKey, TValue, TSelf>
  6. {
  7. protected override void GetAssetKeyValue(TSerializable asset, out TKey key, out TValue value)
  8. {
  9. key = asset.Key;
  10. value = asset.Value;
  11. }
  12. [Serializable]
  13. public class SerializableDictionary
  14. {
  15. public TKey Key
  16. {
  17. get
  18. {
  19. return this._key;
  20. }
  21. }
  22. public TValue Value
  23. {
  24. get
  25. {
  26. return this._value;
  27. }
  28. }
  29. [SerializeField]
  30. protected TKey _key;
  31. [SerializeField]
  32. protected TValue _value;
  33. }
  34. }
  35. }