So i have my game scene and i want to have my score be displayed in game over scene and my high score. This is my score code:
public class Score : MonoBehaviour
{
public Text scoreText;
public float scoreAmount;
public float pointIncreasedPerSecond;
// Start is called before the first frame update
void Start()
{
scoreAmount = 0f;
pointIncreasedPerSecond = 1f;
}
// Update is called once per frame
void Update()
{
scoreText.text = (int)scoreAmount + "";
scoreAmount +=pointIncreasedPerSecond * Time.deltaTime;
}
}