示例#1
0
        /// <summary>
        /// 设置资源的标签和变种
        /// </summary>
        private void SetAssetBundleLabelAndVariant(AssetInfo assetInfo)
        {
            // 如果资源所在文件夹的名称包含后缀符号,则为变体资源
            string folderName = Path.GetDirectoryName(assetInfo.AssetPath);             // "Assets/Texture.HD/background.jpg" --> "Assets/Texture.HD"

            if (Path.HasExtension(folderName))
            {
                string extension = Path.GetExtension(folderName);
                string label     = AssetBundleCollectorSettingData.GetAssetBundleLabel(assetInfo.AssetPath);
                assetInfo.AssetBundleLabel   = label.Replace(extension, string.Empty);
                assetInfo.AssetBundleVariant = extension.Substring(1);
            }
            else
            {
                assetInfo.AssetBundleLabel   = AssetBundleCollectorSettingData.GetAssetBundleLabel(assetInfo.AssetPath);
                assetInfo.AssetBundleVariant = PatchDefine.AssetBundleDefaultVariant;
            }
        }