In my game i have it so when the player picks up an item the score increases ,there is a max number of items the level lets say ten , at the end of the level a new scene is loaded with some text and a button to load the next level what i’m looking to do is have the text say
" You scored (what they scored )out of 10 "
Is there a way to go about doing that.
here is the code im using to mange the score
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ScoreManager : MonoBehaviour {
static public int score;
public Text scoreText;
void Start ()
{
PlayerPrefs.GetInt ("scorePrefabs");
score=PlayerPrefs.GetInt ("scorePrefabs");
}
void Update ()
{
if (scoreText.name == "scoreText")
{
scoreText.text = "score: " + score;
}
PlayerPrefs.SetInt ("scorePrefabs", score);
}
}
(I am new to coding, Unity and game deign if i’m asking this poorly or in the wrong place i apologize and would be thankful to be pointer in the right direction )