コード例 #1
0
        // 通过路径获取
        public UIFormID GetFormIDByPath(string resPath, ResPathType pathType)
        {
            foreach (UIFormID id in m_id2AttrDic.Keys)
            {
                if (ResPathType.ePathComUI == pathType)
                {
                    if (m_id2AttrDic[id].m_widgetPath == resPath)
                    {
                        return(id);
                    }
                }
                else if (ResPathType.ePathCodePath == pathType)
                {
                    if (m_id2AttrDic[id].m_codePath == resPath)
                    {
                        return(id);
                    }
                }
            }

            return((UIFormID)0);       // 默认返回最大值
        }
コード例 #2
0
ファイル: UIAttrSystem.cs プロジェクト: zhutaorun/unitygame
        // 通过路径获取
        public UIFormID GetFormIDByPath(string resPath, ResPathType pathType)
        {
            foreach(UIFormID id in m_id2AttrDic.Keys)
            {
                if (ResPathType.ePathComUI == pathType)
                {
                    if (m_id2AttrDic[id].m_widgetPath == resPath)
                    {
                        return id;
                    }
                }
                else if (ResPathType.ePathCodePath == pathType)
                {
                    if (m_id2AttrDic[id].m_codePath == resPath)
                    {
                        return id;
                    }
                }
            }

            return (UIFormID)0;       // 默认返回最大值
        }