unity hololens 2运行时obj负载



i使用全息透镜2unity版本为2020.3.25f1
我的项目是从web下载obj并在运行时加载。

Application.persistentDataPath 

我成功下载了此路径
但我无法在运行时加载
我尝试过此资产
https://assetstore.unity.com/packages/tools/modeling/runtime-obj-importer-49547
此资产不适用于HoloLens

还有别的办法吗?

如果我读得正确,下载文件就可以了。既然这是一个编码论坛,你能在帖子中包含你正在使用和编辑的代码吗?

这里有一个关于stackoverflow的示例帖子,展示了如何使用HoloLens:从存储中加载文件

使用Hololens 2(UWP到.NET(上的文件

#if !UNITY_EDITOR && UNITY_WSA_10_0
public async Task<StreamReader> getStreamReader(string path)
{
StorageFile file = await StorageFile.GetFileFromPathAsync(path);
var randomAccessStream = await file.OpenReadAsync();
Stream stream = randomAccessStream.AsStreamForRead();
StreamReader str = new StreamReader(stream);
return str;
}
#endif

最新更新