DataConfMgr.cs 919 B

1234567891011121314151617181920212223242526272829303132
  1. using PublicTools.XMLDataBase;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using XRTool.Util;
  6. namespace XRTool.UI
  7. {
  8. /// <summary>
  9. /// 数据访问单例
  10. /// </summary>
  11. /// <typeparam name="T"></typeparam>
  12. public class DataConfMgr<T> : Singleton<DataConfMgr<T>>
  13. {
  14. private TableHelper<T> tableHelper;
  15. public TableHelper<T> TableHelper { get => tableHelper; set => tableHelper = value; }
  16. public void OpenTable(string priKey = null)
  17. {
  18. TableHelper.Open(priKey);
  19. }
  20. /// <summary>
  21. /// 打开某路径下的资源
  22. /// </summary>
  23. /// <param name="path"></param>
  24. public void OpenData(string path)
  25. {
  26. if (TableHelper == null)
  27. {
  28. TableHelper = new TableHelper<T>(path);
  29. }
  30. }
  31. }
  32. }