更新YooAsset 2.3.3 -> 2.3.7 优化YooAsset.RuntimeExtension以及YooAsset.EditorExtension目录结构

更新YooAsset 2.3.3 -> 2.3.7 优化YooAsset.RuntimeExtension以及YooAsset.EditorExtension目录结构
This commit is contained in:
Alex-Rachel
2025-04-17 12:59:23 +08:00
parent 32418326b1
commit 227283864f
206 changed files with 1641 additions and 461 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using YooAsset.Editor;
[DisplayName("定位地址: 文件名.智能尾缀")]
public class AddressByFileNameAndExt : IAddressRule
{
public string GetAssetAddress(AddressRuleData data)
{
var ext = Path.GetExtension(data.AssetPath);
if (ext == ".asset")
{
var a = UnityEditor.AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(data.AssetPath);
if (a == null) return ".errortype";
var type = a.GetType();
var dt = Path.GetFileNameWithoutExtension(data.AssetPath);
return dt + $".{type.Name.ToLowerInvariant()}";
}
return Path.GetFileName(data.AssetPath);
}
}