public void LoadFile(string fileName, string filePath) { DBFile filedata = new DBFile(); if (filedata.LoadFile(fileName, filePath) == false) { //string message = Utils.BuildFormatString("Load {0} Error,Please check file", fileName); //DebugTools.LogError(DragonEngine.LogCategory.GameLogic, message); Debug.LogError("LoadFile"); } m_RowNum = filedata.getRowNum(); for (int i = 0; i < m_RowNum; i++) { BaseData item = NewItem(); filedata.SetNowRowList(i); try { item.LoadData(i, filedata); m_DataMap[item.m_nId] = item; _OnLoadItem(item); } catch (System.Exception) { //string message = Utils.BuildFormatString("Load File {0}{1} Error: row={2}", filePath, fileName, i); //DebugTools.LogError(DragonEngine.LogCategory.GameLogic, message); Debug.LogError("LoadFile: System.Exception"); return; } _OnLoadComplete(); } }
public override void LoadData(int nRowIndex, DBFile fileData) { int nIndex = 0; m_nId = fileData.getInt(nIndex); nIndex++; m_nGhostID = fileData.getInt(nIndex); nIndex++; m_strIcon = fileData.getString(nIndex); nIndex++; m_strBackgroundIcon = fileData.getString(nIndex); nIndex++; }
public override void LoadData(int nRowIndex, DBFile fileData) { int nIndex = 0; m_nId = fileData.getInt(nIndex); nIndex++; m_fDuration = fileData.getFloat(nIndex); nIndex++; int nTotalProbablity = 0; for (int i = 0; i < Max_Num; i++) { m_aPowerRates [i] = fileData.getInt(nIndex); nIndex++; int nProbablity = fileData.getInt(nIndex); nIndex++; if (nProbablity == 0) { break; } nTotalProbablity += nProbablity; m_aProbabilitys [i] = nTotalProbablity; } }
public virtual void LoadData(int nRowIndex, DBFile fileData) { }