DataConfMgr.cs 904 B

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