public TData LoadCache <TDBData>(TDBData data) where TDBData : DBBase { TData ret = new TData(); Util.CopyToTD(data, ret); CacheData.Add(ret); return(ret); }
/// <summary> /// 加载对象 /// </summary> /// <typeparam name="TDBData"></typeparam> /// <param name="data"></param> /// <param name="copyTable">拷贝表格配置的数值,而不是直接引用</param> /// <returns></returns> public TData Load <TDBData>(TDBData data, bool copyTable = false) where TDBData : DBBase { TData ret = new TData(); if (copyTable) { ret = TDLuaMgr.Get <TData>(data.TDID).Copy <TData>(); } Util.CopyToTD(data, ret); OnLoad(data, ref ret); SpawnAdd(ret, data.TDID, data.ID); return(ret); }