【发布时间】:2020-09-30 00:57:12
【问题描述】:
我一直在将保存的 HighScore 系统添加到我的游戏中,但我收到了这个错误:
无法将 lambda 表达式转换为类型 'bool',因为它不是委托类型
这是我的脚本
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HighScoreDisplay : MonoBehaviour
{
public Text Display;
public static int Score;
private int HighScore;
private int LateScore;
void Start()
{
HighScore = PlayerPrefs.GetInt("HighScore", 0);
}
// Update is called once per frame
void Update()
{
Display.text = (Score.ToString());
// This is the error
if (Score => HighScore)
{
HighScore = Score;
Score = 0;
}
// ^This is the error^
if (HighScore == LateScore)
{
}
else
{
PlayerPrefs.SetInt("HighScore", HighScore);
}
}
void LateUpdate()
{
LateScore = HighScore;
}
}
请帮忙
谢谢 布伦
【问题讨论】: