Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 错误cs0029无法将int类型隐式转换为bool_C# - Fatal编程技术网

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++,它应该编译,但仍然是错误的。