meteorgame/Assets/Scripts/JimmyVegas/GlobalScore.cs

18 lines
395 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GlobalScore : MonoBehaviour
{
public GameObject scoreBox;
public static int currentScore;
public int internalScore;
void Update()
{
internalScore = currentScore;
foreach (Text t in scoreBox.GetComponentsInChildren<Text>()) t.text = "" + internalScore;
}
}