修复了原生文件不支持ini格式文件的问题。
pull/98/head^2
hevinci 2023-04-06 16:32:50 +08:00
parent 896681df87
commit 567c34d4d1
1 changed files with 8 additions and 6 deletions

View File

@ -243,8 +243,8 @@ namespace YooAsset.Editor
return false; return false;
// 忽略编辑器下的类型资源 // 忽略编辑器下的类型资源
Type type = AssetDatabase.GetMainAssetTypeAtPath(assetPath); Type assetType = AssetDatabase.GetMainAssetTypeAtPath(assetPath);
if (type == typeof(LightingDataAsset)) if (assetType == typeof(LightingDataAsset))
return false; return false;
// 检测原生文件是否合规 // 检测原生文件是否合规
@ -252,27 +252,29 @@ namespace YooAsset.Editor
{ {
string extension = StringUtility.RemoveFirstChar(System.IO.Path.GetExtension(assetPath)); string extension = StringUtility.RemoveFirstChar(System.IO.Path.GetExtension(assetPath));
if (extension == EAssetFileExtension.unity.ToString() || extension == EAssetFileExtension.prefab.ToString() || if (extension == EAssetFileExtension.unity.ToString() || extension == EAssetFileExtension.prefab.ToString() ||
extension == EAssetFileExtension.mat.ToString() || extension == EAssetFileExtension.controller.ToString() || extension == EAssetFileExtension.fbx.ToString() || extension == EAssetFileExtension.mat.ToString() ||
extension == EAssetFileExtension.fbx.ToString() || extension == EAssetFileExtension.anim.ToString() || extension == EAssetFileExtension.controller.ToString() || extension == EAssetFileExtension.anim.ToString() ||
extension == EAssetFileExtension.shader.ToString()) extension == EAssetFileExtension.ttf.ToString() || extension == EAssetFileExtension.shader.ToString())
{ {
UnityEngine.Debug.LogWarning($"Raw file pack rule can not support file estension : {extension}"); UnityEngine.Debug.LogWarning($"Raw file pack rule can not support file estension : {extension}");
return false; return false;
} }
// 注意:原生文件只支持无依赖关系的资源 // 注意:原生文件只支持无依赖关系的资源
/*
string[] depends = AssetDatabase.GetDependencies(assetPath, true); string[] depends = AssetDatabase.GetDependencies(assetPath, true);
if (depends.Length != 1) if (depends.Length != 1)
{ {
UnityEngine.Debug.LogWarning($"Raw file pack rule can not support estension : {extension}"); UnityEngine.Debug.LogWarning($"Raw file pack rule can not support estension : {extension}");
return false; return false;
} }
*/
} }
else else
{ {
// 忽略Unity无法识别的无效文件 // 忽略Unity无法识别的无效文件
// 注意:只对非原生文件收集器处理 // 注意:只对非原生文件收集器处理
if (type == typeof(UnityEditor.DefaultAsset)) if (assetType == typeof(UnityEditor.DefaultAsset))
{ {
UnityEngine.Debug.LogWarning($"Cannot pack default asset : {assetPath}"); UnityEngine.Debug.LogWarning($"Cannot pack default asset : {assetPath}");
return false; return false;