C# Unity 2D测试贯穿始终的多个错误

C# Unity 2D测试贯穿始终的多个错误,c#,unity3d,C#,Unity3d,尝试创建具有附加效果的简单2D测验,但在开发时不断遇到错误。我已经包括了我的代码和每次运行时收到的错误 使用系统集合; 使用UnityEngine; 使用System.Collections.Generic; 使用System.Linq; 公共类GameManager:MonoBehavior{ 公共问题[]问题; 私有静态列表未回答的问题; 私人问题; 无效开始() { if(unansweredQuestions==null | | unansweredQuestions.count=0)

尝试创建具有附加效果的简单2D测验,但在开发时不断遇到错误。我已经包括了我的代码和每次运行时收到的错误

使用系统集合;
使用UnityEngine;
使用System.Collections.Generic;
使用System.Linq;
公共类GameManager:MonoBehavior{
公共问题[]问题;
私有静态列表未回答的问题;
私人问题;
无效开始()
{
if(unansweredQuestions==null | | unansweredQuestions.count=0)
{
未回答的问题=问题。ToList();
}
}
}

谢谢。

消息“'List'不包含'count'[…]的定义”表示,未回答的问题没有“count”的实现。C#区分大小写,类列表使用大写字母C实现Count。因此,请尝试将.Count替换为.Count,然后检查代码是否在之后工作。

您是否可以添加代码类
问题
?如果能够传递错误消息,而不是使用screan shot,那就太好了。“CS1061:'列表'不包含'计数'的定义…”。。。我猜你想要Linq,这是一个输入错误。
未回答的问题。count=0
是赋值,而不是条件。你是说
未回答的问题。计数==0
吗?另外,如果你想让Unity调用它,你可能想将
开始
重命名为
开始
。我投票结束这个问题。你的代码似乎全是打字错误。。。对于软件包的错误,请确保您已将软件包更新为最新版本,它支持您正在使用的Unity版本,并可能删除
文件夹,让Unity重新创建该文件包。该文件包仅解决了一个问题,并且只是代码和OP项目中的多个问题之一
using System.Collections;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;

public class GameManager : MonoBehaviour {

    public Question[] questions;
    private static List<Question> unansweredQuestions;
    private Question currentQuestion;

    void start ()
    {

        if (unansweredQuestions == null || unansweredQuestions.count = 0)
        {

            unansweredQuestions = questions.ToList<Question>();
        }
    }



}