[英]error CS0165: Use of unassigned local variable `color'
I got this error when compiling a unity game. 编译统一游戏时出现此错误。 How to fix this ?
如何解决呢?
Thanks 谢谢
Assets/spine-unity/Mesh Generation/Arrays/ArraysMeshGenerator.cs(221,21): error CS0165: Use of unassigned local variable `color' 资产/ spine-unity /网格生成/数组/ArraysMeshGenerator.cs(221,21):错误CS0165:使用未分配的局部变量“颜色”
And another Assets/spine-unity/Mesh Generation/Arrays/ArraysMeshGenerator.cs(157,19): error CS0165: Use of unassigned local variable `color' 还有另一个Assets / spine-unity / Mesh Generation / Arrays / ArraysMeshGenerator.cs(157,19):错误CS0165:使用未分配的局部变量“颜色”
Line 157 157行
colors[vi] = color; colors[vi + 1] = color; colors[vi + 2] = color; colors[vi + 3] = color;
Line 221 221行
colors[vi] = color; uvs[vi].x = attachmentUVs[iii]; uvs[vi].y = attachmentUVs[iii + 1];
Replace line 116 更换第116行
Color32 color;
with 与
Color32 color = default(Color);
Source code (which has the problem): 源代码(有问题):
https://github.com/EsotericSoftware/spine-runtimes/blob/3.4.02/spine-unity/Assets/spine-unity/Mesh%20Generation/Arrays/ArraysMeshGenerator.cs https://github.com/EsotericSoftware/spine-runtimes/blob/3.4.02/spine-unity/Assets/spine-unity/Mesh%20Generation/Arrays/ArraysMeshGenerator.cs
This is assuming you are using an older version of spine-runtimes like v3.4 as your code and line numbers suggest. 这是假设您使用的是较旧版本的spine运行时,例如v3.4,如代码和行号所示。
If you upgrade to the latest Spine Unity runtime (for instance version 3.6.39), you will also have this problem, but in a different file (SpineMesh.cs): 如果升级到最新的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 https://github.com/EsotericSoftware/spine-runtimes/blob/3.6.39/spine-unity/Assets/spine-unity/Mesh%20Generation/SpineMesh.cs
In this case, apply the same fix to lines 460 and 664. 在这种情况下,将相同的修补程序应用于行460和664。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.