mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-17 05:10:12 +00:00
34 lines
944 B
C#
34 lines
944 B
C#
using System.IO;
|
|
|
|
namespace YooAsset.Editor
|
|
{
|
|
[DisplayName("定位地址: 文件名")]
|
|
public class AddressByFileName : IAddressRule
|
|
{
|
|
string IAddressRule.GetAssetAddress(AddressRuleData data)
|
|
{
|
|
return Path.GetFileNameWithoutExtension(data.AssetPath);
|
|
}
|
|
}
|
|
|
|
[DisplayName("定位地址: 分组名+文件名")]
|
|
public class AddressByGroupAndFileName : IAddressRule
|
|
{
|
|
string IAddressRule.GetAssetAddress(AddressRuleData data)
|
|
{
|
|
string fileName = Path.GetFileNameWithoutExtension(data.AssetPath);
|
|
return $"{data.GroupName}_{fileName}";
|
|
}
|
|
}
|
|
|
|
[DisplayName("定位地址: 文件夹名+文件名")]
|
|
public class AddressByFolderAndFileName : IAddressRule
|
|
{
|
|
string IAddressRule.GetAssetAddress(AddressRuleData data)
|
|
{
|
|
string fileName = Path.GetFileNameWithoutExtension(data.AssetPath);
|
|
string collectorName = Path.GetFileNameWithoutExtension(data.CollectPath);
|
|
return $"{collectorName}_{fileName}";
|
|
}
|
|
}
|
|
} |