RedDotConfigAsset.cs 823 B

12345678910111213141516171819202122232425
  1. using System.Collections.Generic;
  2. using Sirenix.OdinInspector;
  3. using Sirenix.Serialization;
  4. namespace YIUIFramework
  5. {
  6. //[CreateAssetMenu(fileName = "RedDotConfigAsset", menuName = "YIUI/RedDot/RedDotConfigAsset", order = 2)]
  7. [LabelText("红点关系配置资源")]
  8. public class RedDotConfigAsset : SerializedScriptableObject
  9. {
  10. [OdinSerialize]
  11. [ReadOnly]
  12. [ShowInInspector]
  13. public Dictionary<int, RedDotConfigData> m_AllRedDotConfigDic =
  14. new Dictionary<int, RedDotConfigData>();
  15. public IReadOnlyDictionary<int, RedDotConfigData> AllRedDotConfigDic => m_AllRedDotConfigDic;
  16. public RedDotConfigData GetConfigData(int key)
  17. {
  18. m_AllRedDotConfigDic.TryGetValue(key, out var value);
  19. return value;
  20. }
  21. }
  22. }