i dont know were is the probleme is i think i made everything right i tried everything but nothing worked it dosent show anything in my phone
here is my code :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class GameMaster : MonoBehaviour
{
public float slowness = 10f;
public Text score;
bool asLost;
float vr;
public Text highscor;
private void Start()
{
vr = 0;
highscor.text = PlayerPrefs.GetFloat("HS", 0).ToString("F0");
}
private void Update()
{
if (asLost == false)
{
vr = Time.timeSinceLevelLoad * 10;
score.text = vr.ToString("F0");
if (vr > PlayerPrefs.GetFloat("HS", 0))
{
PlayerPrefs.SetFloat("HS", vr);
PlayerPrefs.Save();
}
}
}
public void EndGame()
{
StartCoroutine(RestartLevel());
}
IEnumerator RestartLevel()
{
Time.timeScale = 1f / slowness;
Time.fixedDeltaTime = Time.fixedDeltaTime / slowness;
yield return new WaitForSeconds(2f / slowness);
Time.timeScale = 1f;
Time.fixedDeltaTime = Time.fixedDeltaTime * slowness;
}
public GameObject restartPanel;
public void GameOver()
{
Invoke("Delay", 1.5f);
asLost = true;
}
void Delay()
{
restartPanel.SetActive(true);
Time.timeScale = 0f;
}
public void Restart()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
Time.timeScale = 1;
}
public void GoToMainMenu()
{
SceneManager.LoadScene("MainMenu");
Time.timeScale = 1;
}
}