unity cloth开发中遇到的一个问题

来源:互联网 发布:unity3d 灯光 编辑:程序博客网 时间:2024/04/28 10:29

在unity 5.x开发中遇到了一个很郁闷的问题,这个问题不会影响你的游戏的运行,但是却会使你在演示或是交流的时候出现尴尬。

问题描述:Mesh.colors is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.
UnityEditor.ClothInspector:OnEnable()

IndexOutOfRangeException: Array index is out of range.
UnityEditor.ClothInspector.SetupSelectedMeshColors () (at C:/buildslave/unity/build/Editor/Mono/Inspector/ClothInspector.cs:337)
UnityEditor.ClothInspector.OnEnable () (at C:/buildslave/unity/build/Editor/Mono/Inspector/ClothInspector.cs:249)

看到这两个代码,就知道不是自己的代码的问题,但是又很担心是不是自己写的代码与Unity中的cloth模块冲突了。

其实这个问题普遍会出现在对Resource中的资源导入时出的错误。如果你直接在Resourse文件夹中更改Prefab的参数,当在导入Resourse文件夹中cloth布料时就会出现上述问题。如果非要调节参数,最好是将文件拉到Hierarchy面板中,再进行修改


0 0
原创粉丝点击