protected override void OnLoad() { dtUIForm = GameEntry.DataTable.GetDataTable <DRUIForm>(); if (dtUIForm == null) { throw new System.Exception("Can not get data table UIForm"); } dtUIGroup = GameEntry.DataTable.GetDataTable <DRUIGroup>(); if (dtUIGroup == null) { throw new System.Exception("Can not get data table UIGroup"); } dicUIData = new Dictionary <int, UIData>(); dicUIGroupData = new Dictionary <int, UIGroupData>(); DRUIForm[] drUIForms = dtUIForm.GetAllDataRows(); foreach (var drUIForm in drUIForms) { UIGroupData uiGroupData = null; if (!dicUIGroupData.TryGetValue(drUIForm.UIGroupId, out uiGroupData)) { DRUIGroup dRUIGroup = dtUIGroup.GetDataRow(drUIForm.UIGroupId); if (dRUIGroup == null) { throw new System.Exception("Can not find UIGroup id :" + drUIForm.UIGroupId); } uiGroupData = new UIGroupData(dRUIGroup); dicUIGroupData.Add(drUIForm.UIGroupId, uiGroupData); } DRAssetsPath dRAssetsPath = GameEntry.Data.GetData <DataAssetsPath>().GetDRAssetsPathByAssetsId(drUIForm.AssetId); UIData uiData = new UIData(drUIForm, dRAssetsPath, uiGroupData); dicUIData.Add(drUIForm.Id, uiData); } }
public UIGroupData(DRUIGroup dRUIGroup) { this.dRUIGroup = dRUIGroup; }