meteorgame/Assets/Scripts/JimmyVegas/GlobalScore.cs

18 lines
395 B
C#
Raw Permalink Normal View History

2021-03-18 15:56:10 +00:00
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;
}
}