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