美文网首页
Bug记录—AA加载文件失败——无法识别类型

Bug记录—AA加载文件失败——无法识别类型

作者: CZKGO | 来源:发表于2024-04-21 23:33 被阅读0次
UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. No Asset found with for Key=EventData. Key exists as Type=UnityEditor.DefaultAsset, which is not assignable from the requested Type=UnityEngine.TextAsset
UnityEngine.AddressableAssets.Addressables:LoadAssetAsync<UnityEngine.TextAsset> (object)
Script.Resource.AAResourceManager:LoadDataAssetAsync<UnityEngine.TextAsset> (string) (at Assets/Script/Resource/AAResourceManager.cs:15)
GameManager/<GetDatas>d__7:MoveNext () (at Assets/Script/Manager/GameManager.cs:63)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Collections.Generic.Dictionary`2<System.Type, byte[]>>:Start<GameManager/<GetDatas>d__7> (GameManager/<GetDatas>d__7&)
GameManager:GetDatas ()
GameManager/<Init>d__6:MoveNext () (at Assets/Script/Manager/GameManager.cs:53)
System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<GameManager/<Init>d__6> (GameManager/<Init>d__6&)
GameManager:Init ()
GameManager:Awake () (at Assets/Script/Manager/GameManager.cs:35)

解决方法:文件由.dat后缀改为.bytes后缀就可以了。
原因猜测:Unity中,.bytes文件被视为TextAsset类型的文件.dat不是?

相关文章

网友评论

      本文标题:Bug记录—AA加载文件失败——无法识别类型

      本文链接:https://www.haomeiwen.com/subject/ycjbxjtx.html