0

编译统一游戏时出现此错误。如何解决这个问题?

谢谢

Assets/spine-unity/Mesh Generation/Arrays/ArraysMeshGenerator.cs(221,21):错误 CS0165:使用未分配的局部变量“颜色”

还有另一个 Assets/spine-unity/Mesh Generation/Arrays/ArraysMeshGenerator.cs(157,19): error CS0165: Use of unassigned local variable ‘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];
4

1 回答 1

3

替换第 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

这是假设您使用的是旧版本的主干运行时,如您的代码和行号所建议的 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 行应用相同的修复。

于 2018-07-12T20:12:58.197 回答