0% found this document useful (0 votes)
20 views2 pages

Programa

The ScoreManager class manages the player's score in a Unity game. It tracks current points and updates the maximum points achieved using PlayerPrefs. The score is displayed on the UI through Text components for current and maximum points.

Uploaded by

geovannyjsuarez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Programa

The ScoreManager class manages the player's score in a Unity game. It tracks current points and updates the maximum points achieved using PlayerPrefs. The score is displayed on the UI through Text components for current and maximum points.

Uploaded by

geovannyjsuarez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

using System.

Collections;

using [Link];

using UnityEngine;

using [Link];

public class ScoreManager : MonoBehaviour

public static ScoreManager Instance {get; private set; }

public Text pointsText, maxPointsText;

[SerializeField] private int points = 0;

void Awake()

Instance = this;

void Start()

UpdateMaxPoints();

public void IncreasePoints ()

points++;

[Link] = " " + [Link]();

UpdateMaxPoints();

public void UpdateMaxPoints()

{
int maxPoints = [Link]("Max", 0);

if(points >= maxPoints)

maxPoints = points;

[Link]("Max", maxPoints);

[Link] = "BEST: " + [Link]();

You might also like