using XGame.Framework.Asset; using System; using UnityEngine; namespace XGame.Editor.Asset { public static class PathDefine { #region 常量 /// /// Packages相对路径前缀 /// public const string PackageRelative = "Packages/"; /// /// Packages全路径前缀 /// public const string PackageReality = "Library/PackageCache/"; /// /// 框架在Package里的bundleId /// public const string XGameBundleId = "com.xgame.framework"; //"com.unity.ui.builder"; /// /// Assets相对路径前缀 /// public const string AssetsRelative = "Assets/"; /// /// Addressable资源 /// public const string ResAddressableName = "Res/Addressable"; /// /// 静态资源,不可动态加载 /// public const string ResStaticName = "Res/Static"; /// /// Resources /// public const string ResourcesName = "Resources"; /// /// i18n文件夹 /// public const string I18nName = "i18n"; ///// ///// ResStatic资源对应的bundle名前缀 ///// //public const string rawBundlePrefix = "raw_"; /// /// Lod资源文件名后缀 /// 高品质 /// public const string LodHigh = "_high"; /// /// lod资源文件名后缀 /// 低品质 /// public const string LodLow = "_low"; #endregion #region Package /// /// 框架在Package里的相对路径 /// public static string XGamePackageRelative => $"{PackageRelative}{XGameBundleId}"; /// /// 内置资源相对路径 /// AssetDatabase.Load不支持"/"结尾 /// public static string BuiltInResourcesRelative => $"{PackageRelative}{XGameBundleId}/{ResourcesName}"; /// /// 内置资源ResStatic相对路径 /// public static string BuiltInResTests => $"{PackageRelative}{XGameBundleId}/{ResStaticName}/Tests"; #endregion #region Asset private static readonly string AppDataPath = Application.dataPath; public static readonly string AssetsEditor = "Assets/Editor"; /// /// Addressable资源相对路径 /// AssetDatabase.Load不支持"/"结尾 /// public static string ResAddressableRelative = $"{AssetsRelative}{ResAddressableName}"; /// /// 静态资源相对路径 /// public static string ResStaticRelative = $"{AssetsRelative}{ResStaticName}"; /// /// Resources相对路径 /// public static string ResourcesRelative = $"{AssetsRelative}{ResourcesName}"; /// /// 国际化资源目录相对路径 /// public static string I18nAssetsRelative = $"{AssetsRelative}{I18nName}/"; /// /// 动态资源全路径 /// public static string ResAddressablePath => $"{AppDataPath}/{ResAddressableName}"; /// /// 静态资源全路径 /// public static string ResStaticPath => $"{AppDataPath}/{ResStaticName}"; /// /// Resources全路径 /// public static string ResourcesPath => $"{AppDataPath}/{ResourcesName}"; /// /// 国际化资源目录全路径 /// public static string I18nAssetsPath => $"{AppDataPath}/{I18nName}/"; #endregion #region Addressable | AssetBundle /// /// bundle数据相对路径 /// public static readonly string ConfigsRelative = "Assets/AssetConfigs/"; public static readonly string AddressableDataRelative = $"{ConfigsRelative}Addressable/"; public static string BundleManifestPath => $"{ConfigsRelative}{Define.ASSET_BUNDLE_MANIFEST}.asset"; public static string ReferenceManifestPath => $"{ConfigsRelative}{Define.ASSET_REFERENCE_MANIFEST}.asset"; public static string SceneAssetBundleManifestPath => $"{ConfigsRelative}{Define.SCENE_BUNDLE_MANIFEST}.asset"; /// /// 项目资源的Addressable配置文件 /// public static string ProductAssetManifestPath => $"{AddressableDataRelative}{Define.PRODUCT_ASSET_MANIFEST}.asset"; /// /// 内置资源的Addressable配置文件 /// public static string BuiltInAssetManifestPath => $"{AddressableDataRelative}{Define.BUILTIN_ASSET_MANIFEST}.asset"; /// /// 测试资源的Addressable配置文件 /// public static string TestAssetsManifestPath => $"{AddressableDataRelative}TestAssetsManifest.asset"; /// /// Addressable的备份文件,用于记录自定义名字的资源信息 /// public static string AddressableBackupManifestPath => $"{AddressableDataRelative}BackupManifest.asset"; /// /// 分包规则配置文件 /// public static string ABPackerManifestPath => $"{ConfigsRelative}PackerInfoManifest.asset"; /// /// AssetsConfig路径 /// public static string AssetsConfigPath => $"{AssetsEditor}/AssetsConfig.asset"; #endregion /// /// ExtAssets文件夹路径 /// public static string ExtAssetsPath => $"{Environment.CurrentDirectory.Replace("\\", "/")}/ExtAssets"; /// /// 打包默认输出路径 /// public static string DefaultOutputPath => $"{ExtAssetsPath}/output"; /// /// AssetBundle输出路径 /// public static string AssetBundleOutputPath => $"{ExtAssetsPath}/StreamAssets/{PlatformUtil.ActivePlatform}/AssetBundles"; public static string TestsToAddressable => $"{AssetsRelative}Res/Tests"; } }