tuyoogame / YooAsset

unity3d resources management system
https://www.yooasset.com/
Apache License 2.0
2.37k stars 466 forks source link

关于打包模式问题RawFilePipline 版本2.0.3preview #221

Open Nottheyouth opened 8 months ago

Nottheyouth commented 8 months ago

我在尝试把我项目之前的1.5几版本更新到最近的2.0.3版本,运行时发现LoadRawFileAsync要求我pack打包是RawFile模式,但是在之前的版本可以正常调用,我想了解一下这么做是为了更好的做哪些事情吗,我只有一个DefaultPackage包,之前的打包模式是BuiltinBuildPipeline模式

    private void DebugCheckAssetLoadMethod(string method)
    {
        if (_playModeImpl.ActiveManifest.BuildPipeline == EDefaultBuildPipeline.RawFileBuildPipeline.ToString())
        {
            throw new Exception($"Cannot load raw file using {method} method !");
        }
    }
gmhevinci commented 8 months ago

2.0版本开始,原生文件构建需要使用单独的package,然后通过RawFileBuildPipeline来构建资源。

9a6c commented 7 months ago

WaitForAsyncComplete failed ! Try load bundle : defaultpackage_assets_hotasset_generateddata_scenebuildconfig_asset.rawfile from remote with sync load method !

新版本如何加载asset文件呢?

9a6c commented 7 months ago

可以在例子里加一个相关的内容吗(原生文件文件和初始化)?

gmhevinci commented 7 months ago

可以在例子里加一个相关的内容吗(原生文件文件和初始化)?

嗯。我写一个原生文件相关的独立文档

gmhevinci commented 7 months ago

WaitForAsyncComplete failed ! Try load bundle : defaultpackage_assets_hotasset_generateddata_scenebuildconfig_asset.rawfile from remote with sync load method !

新版本如何加载asset文件呢?

这个错误提示你正在用同步方法加载本地不存在的原始文件。如果不确定资源文件在本地是否存在,你可以用异步方法。

9a6c commented 7 months ago

WaitForAsyncComplete failed ! Try load bundle : defaultpackage_assets_hotasset_generateddata_scenebuildconfig_asset.rawfile from remote with sync load method ! 新版本如何加载asset文件呢?

这个错误提示你正在用同步方法加载本地不存在的原始文件。如果不确定资源文件在本地是否存在,你可以用异步方法。

感谢您的回复, 我已经知道原因了, 目前对新版本的RawFilePipline模式不是很明白,那些资源需要这样处理呢?

bj-gegf commented 6 months ago

也遇到同样的问题了,在EditorSimulateMode下,读原始文件会说不是原生文件管道 然后尝试把原生文件的包设成原生文件管道 initParameters.SimulateManifestFilePath = EditorSimulateModeHelper.SimulateBuild(EDefaultBuildPipeline.RawFileBuildPipeline, ...) 这样在 var handle = hotPackage.LoadRawFileSync(assetInfo); yield return handle; 的时候就不会往下走了