C# 错误cs0029无法将int类型隐式转换为bool
我有以下代码:C# 错误cs0029无法将int类型隐式转换为bool,c#,C#,我有以下代码: GameObject g = Instantiate(gemPrefab,new isMatched = true; for (int i = 0; rows.Count; i++) { rows[i].isMatched = true; } if (collumns.Count >= AmountToMatch) { isMatched=true; } for(int i=0;collumns.Count
GameObject g = Instantiate(gemPrefab,new
isMatched = true;
for (int i = 0; rows.Count; i++)
{
rows[i].isMatched = true;
}
if (collumns.Count >= AmountToMatch)
{
isMatched=true;
}
for(int i=0;collumns.Count;i++)
但是,我得到以下错误:
错误cs0029无法将int类型隐式转换为bool(107,25)和(115,25)
如何修复此问题?您在(…)表达式的
中的条件必须是布尔表达式
所以,与其说是行数,不如说是行数,你真正的意思是什么?可能i
第115行的表达式也是如此。你想<代码>我> Culun.Cuth< <代码> . CS2009似乎是一个C错误消息,这是有意义的,因为如果是C++,它应该编译,但仍然是错误的。