Я получаю эту ошибку в единстве, моя проблема - рекорд, она не работает.Я пробовал все виды видео на YouTube, но я думаю, что я делаю что-то не так во всех из них.Также пытался с текстовой рекорд и также не работает.Он говорит мне: «Вам не хватает ссылки на сборку?»
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ScoreScript : MonoBehaviour {
public static int scoreValue = 0;
public Text score;
public static int highscore;
void Start () {
highscore.Text = PlayerPrefs.GetInt("HighScore", 0);
score = GetComponent<Text>();
scoreValue = 0;
}
void Update () {
score.text = "" + scoreValue;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class hazardCollisionFunctions : MonoBehaviour {
private void OnCollisionEnter(Collision col){
if(col.gameObject.tag == "Platform"){
this.gameObject.SetActive(false);
ScoreScript.scoreValue += 1;
}
if(col.gameObject.tag == "Player"){
if(ScoreScript.highscore < ScoreScript.scoreValue){
PlayerPrefs.SetInt("HighScore", ScoreScript.scoreValue);
}
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}
}