Bug記錄—AA加載文件失敗——無法識(shí)別類型

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后綴就可以了。
原因猜測(cè):Unity中,.bytes文件被視為TextAsset類型的文件.dat不是?

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容