扩展名为 .bytes 的文件会被 Unity 当作文本文件处理,但是我在将 .bytes 文件打包成 AssetBundle 的时候遇到这个警告导致打包失败:
Unrecognized assets cannot be included in AssetBundles: "Assets/StreamingAssets/0-Explore/Android/encrypted/half_hand.bytes".
UnityEditor.BuildPipeline:BuildAssetBundles(String, AssetBundleBuild[], BuildAssetBundleOptions, BuildTarget)
Packager:EncryptFiles() (at Assets/Editor/Yueran/Packager.cs:225)
Packager:BuildExploreAssetResource() (at Assets/Editor/Yueran/Packager.cs:166)
Packager:BuildAndroidResource() (at Assets/Editor/Yueran/Packager.cs:42)
仔细排查发现只要将 .bytes 文件放到非 StreamingAssets 文件夹就正常了。