/// <summary> /// 获取此表中某条数据 /// </summary> public T GetRecord <T>(uint id) where T : ITableLoad, new() { ConfigTableBase <T> table = GetTableData <T>(); if (table == null) { return(default(T)); } return(table.GetData(id)); }
/// <summary> /// CS脚本显示UI /// </summary> public void ShowCSUI(uint id, Action <GameObject> callback) { if (callback != null) { _Callback[id] = callback; } //看此UI是否已加载 if (_AllUI.ContainsKey(id)) { LoggerHelper.Debug("一个UI显示出来了: " + _AllUI[id].ConfigTable.Name); //已加载,开始显示 MyShowUI(id); var _obj = _AllUI[id].MyCanvas.gameObject; //显示完成后,回调 Action <GameObject> _callback; _Callback.TryGetValue(id, out _callback); if (_callback != null) { _Callback.Remove(id); _callback.Invoke(_obj); } //发送MVC消息 Facade.Instance.SendNotification(string.Concat(_obj.name, MVCNameConst.UI_UIShow)); } else { //未加载,开始加载 if (_UIConfig != null) { UIConfigTable _table = _UIConfig.GetData(id); if (_table != null) { PoolTool.GetGameObject(_table.Name, _table.AssetName, LoadUIBack, _table, EPoolAddType.No); } else { Debug.Log("在UIConfigTable中,不存在此ID:" + id); } } else { Debug.Log("UI配置表未加载!"); } } }