为什么从assetBundle添加MeshCollider时mesh已经被标记为不可访问,如何解决?
Why the mesh has been marked as non-accessible when adding MeshCollider from assetBundle and how to solve it?
我有一个可编写脚本的资产,其中包含 GameObject 变量上的 fxbModel,我正在这样做:
model = Instantiate(caAsset.model, origin);
fbxComponents.All(fbxComponent => fbxComponent.gameObject.AddComponent<MeshCollider>());
资源是从资源加载的,一切正常*
但是如果资源来自于 AssetBundle** 就会出现以下错误。
CollisionMeshData couldn't be created because the mesh has been marked as non-accessible.
Mesh asset path "" Mesh name "Flanschdeckel_low"
UnityEngine.GameObject:AddComponent()
(*)
MyScriptableAsset caAsset = Resources.Load(scriptableObjectName);
(**)
MyScriptableAsset caAsset = bundle.LoadAsset<MyScriptableAsset>(scriptableObjectName);
在网格子文本下的模型选项卡上的 fbx 文件上有一个 read/write 启用 属性 如果您勾选该框,它可能会起作用。检查图片的右角以便更好地理解。enter image description here
我有一个可编写脚本的资产,其中包含 GameObject 变量上的 fxbModel,我正在这样做:
model = Instantiate(caAsset.model, origin);
fbxComponents.All(fbxComponent => fbxComponent.gameObject.AddComponent<MeshCollider>());
资源是从资源加载的,一切正常*
但是如果资源来自于 AssetBundle** 就会出现以下错误。
CollisionMeshData couldn't be created because the mesh has been marked as non-accessible.
Mesh asset path "" Mesh name "Flanschdeckel_low"
UnityEngine.GameObject:AddComponent()
(*)
MyScriptableAsset caAsset = Resources.Load(scriptableObjectName);
(**)
MyScriptableAsset caAsset = bundle.LoadAsset<MyScriptableAsset>(scriptableObjectName);
在网格子文本下的模型选项卡上的 fbx 文件上有一个 read/write 启用 属性 如果您勾选该框,它可能会起作用。检查图片的右角以便更好地理解。enter image description here