parent
ce9e0cd88c
commit
304bff1f19
|
@ -7,9 +7,8 @@ namespace YooAsset.Editor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 以文件路径作为资源包名
|
/// 以文件路径作为资源包名
|
||||||
/// 注意:每个文件独自打资源包
|
/// 注意:每个文件独自打资源包
|
||||||
/// 例如:收集器路径为 "Assets/UIPanel"
|
/// 例如:"Assets/UIPanel/Shop/Image/backgroud.png" --> "assets_uipanel_shop_image_backgroud.bundle"
|
||||||
/// 例如:"Assets/UIPanel/Shop/Image/backgroud.png" --> "assets/uipanel/shop/image/backgroud.bundle"
|
/// 例如:"Assets/UIPanel/Shop/View/main.prefab" --> "assets_uipanel_shop_view_main.bundle"
|
||||||
/// 例如:"Assets/UIPanel/Shop/View/main.prefab" --> "assets/uipanel/shop/view/main.bundle"
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PackSeparately : IPackRule
|
public class PackSeparately : IPackRule
|
||||||
{
|
{
|
||||||
|
@ -23,9 +22,8 @@ namespace YooAsset.Editor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 以父类文件夹路径作为资源包名
|
/// 以父类文件夹路径作为资源包名
|
||||||
/// 注意:文件夹下所有文件打进一个资源包
|
/// 注意:文件夹下所有文件打进一个资源包
|
||||||
/// 例如:收集器路径为 "Assets/UIPanel"
|
/// 例如:"Assets/UIPanel/Shop/Image/backgroud.png" --> "assets_uipanel_shop_image.bundle"
|
||||||
/// 例如:"Assets/UIPanel/Shop/Image/backgroud.png" --> "assets/uipanel/shop/image.bundle"
|
/// 例如:"Assets/UIPanel/Shop/View/main.prefab" --> "assets_uipanel_shop_view.bundle"
|
||||||
/// 例如:"Assets/UIPanel/Shop/View/main.prefab" --> "assets/uipanel/shop/view.bundle"
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PackDirectory : IPackRule
|
public class PackDirectory : IPackRule
|
||||||
{
|
{
|
||||||
|
@ -42,8 +40,8 @@ namespace YooAsset.Editor
|
||||||
/// 以收集器路径下顶级文件夹为资源包名
|
/// 以收集器路径下顶级文件夹为资源包名
|
||||||
/// 注意:文件夹下所有文件打进一个资源包
|
/// 注意:文件夹下所有文件打进一个资源包
|
||||||
/// 例如:收集器路径为 "Assets/UIPanel"
|
/// 例如:收集器路径为 "Assets/UIPanel"
|
||||||
/// 例如:"Assets/UIPanel/Shop/Image/backgroud.png" --> "assets/uipanel/shop.bundle"
|
/// 例如:"Assets/UIPanel/Shop/Image/backgroud.png" --> "assets_uipanel_shop.bundle"
|
||||||
/// 例如:"Assets/UIPanel/Shop/View/main.prefab" --> "assets/uipanel/shop.bundle"
|
/// 例如:"Assets/UIPanel/Shop/View/main.prefab" --> "assets_uipanel_shop.bundle"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PackTopDirectory : IPackRule
|
public class PackTopDirectory : IPackRule
|
||||||
{
|
{
|
||||||
|
@ -74,9 +72,18 @@ namespace YooAsset.Editor
|
||||||
{
|
{
|
||||||
string IPackRule.GetBundleName(PackRuleData data)
|
string IPackRule.GetBundleName(PackRuleData data)
|
||||||
{
|
{
|
||||||
string bundleName = StringUtility.RemoveExtension(data.CollectPath);
|
string collectPath = data.CollectPath;
|
||||||
|
if (AssetDatabase.IsValidFolder(collectPath))
|
||||||
|
{
|
||||||
|
string bundleName = collectPath;
|
||||||
return EditorTools.GetRegularPath(bundleName).Replace('/', '_');
|
return EditorTools.GetRegularPath(bundleName).Replace('/', '_');
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string bundleName = StringUtility.RemoveExtension(collectPath);
|
||||||
|
return EditorTools.GetRegularPath(bundleName).Replace('/', '_');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue