예제 #1
0
        //============================================================
        // <T>根据材质组合主题名称查找材质。</T>
        //
        // @param themeName 主题名称
        // @param groupName 材质组名称
        // @return 材质
        //============================================================
        public FDrMaterial Find(string themeName, string groupName)
        {
            string           groupCode = RDrUtil.FormatPathToCode(groupName);
            string           themeCode = RDrUtil.FormatPathToCode(themeName);
            FDrMaterialGroup group     = _materials.Find(groupCode);

            if (null != group)
            {
                return(group.FindMaterial(themeCode));
            }
            return(null);
        }
예제 #2
0
        //============================================================
        // <T>根据材质组合主题名称查找材质。</T>
        //
        // @param themeName 主题名称
        // @param groupName 材质组名称
        // @return 材质
        //============================================================
        public FDrMaterial FindDefault(string themeName, string groupName)
        {
            string           groupCode = RDrUtil.FormatPathToCode(groupName);
            string           themeCode = RDrUtil.FormatPathToCode(themeName);
            FDrMaterialGroup group     = _materials.Find(groupCode);
            FDrMaterial      material  = null;

            if (null != group)
            {
                material = group.FindMaterial(themeCode);
            }
            if (null == material)
            {
                if (null != group)
                {
                    if (!group.Materials.IsEmpty)
                    {
                        material = group.Materials.First;
                    }
                }
            }
            return(material);
        }