public UIGroupData[] GetAllUIGroupData()
        {
            int index = 0;

            UIGroupData[] results = new UIGroupData[dicUIGroupData.Count];
            foreach (var uiGroupData in dicUIGroupData.Values)
            {
                results[index++] = uiGroupData;
            }

            return(results);
        }
        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 UIData(DRUIForm dRUIForm, DRAssetsPath dRAssetsPath, UIGroupData uiGroupData)
 {
     this.dRUIForm     = dRUIForm;
     this.dRAssetsPath = dRAssetsPath;
     this.uiGroupData  = uiGroupData;
 }