[英]can anyone what I'm going wrong as I'm new in unity error CS0165: Use of unassigned local variable 'diff'
enter image description here error CS0165: Use of unassigned local variable 'diff'在此处输入图像描述错误 CS0165:使用未分配的局部变量 'diff'
enter image description here在此处输入图像描述
1 : htstrong texttps://i.stack.imgur.com/bML6I.png 1 :htstrong texttps://i.stack.imgur.com/bML6I.png
I believe this must be happening because you need a specific condition to set the diff variable.我相信这一定会发生,因为您需要一个特定的条件来设置 diff 变量。 If that condition is not met, you're not setting it at all.
如果不满足该条件,则根本没有设置它。
To fix try setting the diff variable to some value in the else statement on line 27.要修复尝试在第 27 行的 else 语句中将 diff 变量设置为某个值。
Let me know if that works for you.让我知道这是否适合你。
Vlad弗拉德
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.