123456789101112131415161718192021222324252627282930313233343536 |
- using PublicTools.XMLDataBase;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using XRTool.Util;
- namespace XRTool.UI
- {
- /// <summary>
- /// 数据访问单例
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public class DataConfMgr<T> : Singleton<DataConfMgr<T>>
- {
- private TableHelper<T> tableHelper;
- public TableHelper<T> TableHelper { get => tableHelper; set => tableHelper = value; }
- public void OpenTable(string priKey = null)
- {
- TableHelper.Open(priKey);
- }
- /// <summary>
- /// 打开某路径下的资源
- /// </summary>
- /// <param name="path"></param>
- public void OpenData(string path, bool isForce = false)
- {
- if (TableHelper == null || isForce)
- {
- if (TableHelper != null)
- {
- TableHelper.Reset();
- }
- TableHelper = new TableHelper<T>(path);
- }
- }
- }
- }
|