错误 CS0103:名称 'SetSolvedState' 在当前上下文中不存在

error CS0103: The name 'SetSolvedState' does not exist in the current context

大家好,代码中有错误,不知道如何解决。这是代码本身。

if (Input.GetKeyDown(KeyCode.F))
        {
            if (dotRight >= threshold && dotup >= threshold)
            {
                SetSolvedState(true);
            }
            else
            {
                SetSolvedState(false);
            }
        }
    }
}

错误消息告诉您问题所在:“SetSolvedState”方法不存在或无法访问。所以你必须创建它,或者如果它已经被定义,你必须检查为什么它不能被使用。例如,它可以是私有的并且必须受到保护,甚至可以改为 public。如果您自己无法找出问题所在,请必须添加整个项目,因为仅靠这些代码行无法发现问题。