Exemple #1
0
        public static bool HasUIForm(this UIComponent uiComponent, int uiFormId, string uiGroupName = null)
        {
            IDataTable <DRUIForm> dtUIForm = GameEntry.DataTable.GetDataTable <DRUIForm>();
            DRUIForm drUIForm = dtUIForm.GetDataRow(uiFormId);

            if (drUIForm == null)
            {
                return(false);
            }

            string assetName = AssetUtility.GetUIFormAsset(drUIForm.AssetName);

            if (string.IsNullOrEmpty(uiGroupName))
            {
                return(uiComponent.HasUIForm(assetName));
            }

            IUIGroup uiGroup = uiComponent.GetUIGroup(uiGroupName);

            if (uiGroup == null)
            {
                return(false);
            }

            return(uiGroup.HasUIForm(assetName));
        }
        //是否存在界面
        public static bool HasUIForm(this UIComponent uiComponent, int uiFormId, string uiGroupName = null)
        {
            //获取界面配置表数据
            IDataTable <DRUIForm> dtUIForm = GameEntry.DataTable.GetDataTable <DRUIForm>();
            DRUIForm drUIForm = dtUIForm.GetDataRow(uiFormId);

            if (drUIForm == null)
            {
                return(false);
            }

            //获取界面资源路径
            string assetName = RuntimeAssetUtility.GetUIFormAsset(drUIForm.AssetName);

            //界面组名为空则直接检查当前是否存在界面
            if (string.IsNullOrEmpty(uiGroupName))
            {
                return(uiComponent.HasUIForm(assetName));
            }

            //获取界面组
            IUIGroup uiGroup = uiComponent.GetUIGroup(uiGroupName);

            if (uiGroup == null)
            {
                return(false);
            }
            //界面组中检查
            return(uiGroup.HasUIForm(assetName));
        }
        /// <summary>
        /// 界面组中是否存在界面。
        /// </summary>
        /// <param name="uiFormTypeId">界面类型编号。</param>
        /// <param name="uiGroupName">界面组名称。</param>
        /// <returns>界面组中是否存在界面。</returns>
        public bool HasUIForm(int uiFormTypeId, string uiGroupName)
        {
            IUIGroup uiGroup = GetUIGroup(uiGroupName);

            if (uiGroup == null)
            {
                throw new GameFrameworkException(string.Format("UI group '{0}' is not exist.", uiGroupName));
            }

            return(uiGroup.HasUIForm(uiFormTypeId));
        }
Exemple #4
0
        public static bool HasUIForm(this UIComponent uiComponent, UIFormId uiFormId, string uiGroupName = null)
        {
            string assetName = AssetUtility.GetUIFormAsset(uiFormId);

            if (string.IsNullOrEmpty(uiGroupName))
            {
                return(uiComponent.HasUIForm(assetName));
            }

            IUIGroup uiGroup = uiComponent.GetUIGroup(uiGroupName);

            if (uiGroup == null)
            {
                return(false);
            }

            return(uiGroup.HasUIForm(assetName));
        }
Exemple #5
0
        public static bool HasUIForm <T>(this IUIManager uiManager, int uiFormId, string uiGroupName = null) where T : IDataRow
        {
            Guard.Verify <LogicException>(GetUIFormInfo == null, "Must transfer the Extend() method before GetUIFormInfo() method.");

            UIFormInfo uiFormInfo = GetUIFormInfo(uiFormId);

            if (string.IsNullOrEmpty(uiGroupName))
            {
                return(uiManager.HasUIForm(uiFormInfo.AssetName));
            }

            IUIGroup uiGroup = uiManager.GetUIGroup(uiGroupName);

            if (uiGroup == null)
            {
                return(false);
            }

            return(uiGroup.HasUIForm(uiFormInfo.AssetName));
        }
        public static bool HasUIForm(this UIComponent uiComponent, int uiFormId, string uiGroupName = null)
        {
            UIData uiData = GameEntry.Data.GetData <DataUI>().GetUIData(uiFormId);

            if (uiData == null)
            {
                return(false);
            }

            if (string.IsNullOrEmpty(uiGroupName))
            {
                return(uiComponent.HasUIForm(uiData.AssetPath));
            }

            IUIGroup uiGroup = uiComponent.GetUIGroup(uiGroupName);

            if (uiGroup == null)
            {
                return(false);
            }

            return(uiGroup.HasUIForm(uiData.AssetPath));
        }