我在编译团结游戏时遇到了这个错误。如何解决此问题?
感谢
Assets/spine unity/Mesh Generation/Arrays/ArraysMeshGenerator.cs(221,21(:错误CS0165:使用未分配的局部变量"color">
还有另一个Assets/spine unity/Mesh Generation/Arrays/ArraysMeshGenerator.cs(157,19(:错误CS0165:使用未分配的局部变量"color">
157线
colors[vi] = color; colors[vi + 1] = color; colors[vi + 2] = color; colors[vi + 3] = color;
221号线
colors[vi] = color; uvs[vi].x = attachmentUVs[iii]; uvs[vi].y = attachmentUVs[iii + 1];
替换第116行
Color32 color;
带有
Color32 color = default(Color);
源代码(有问题(:
https://github.com/EsotericSoftware/spine-runtimes/blob/3.4.02/spine-unity/Assets/spine-unity/Mesh%20Generation/Arrays/ArraysMeshGenerator.cs
这是假设您使用的是旧版本的spine运行时,如您的代码和行号所示,如v3.4。
如果您升级到最新的Spine Unity运行时(例如3.6.39版本(,您也会遇到这个问题,但在不同的文件(SpineMesh.cs(中:
https://github.com/EsotericSoftware/spine-runtimes/blob/3.6.39/spine-unity/Assets/spine-unity/Mesh%20Generation/SpineMesh.cs
在这种情况下,对线460和664应用相同的固定。