using TMPro; using UnityEngine; public class ServerWorkTopRightScore : MonoBehaviour { public static ServerWorkTopRightScore Instance; public static int ScoreVal1 = 60; public static int ScoreVal2 = 60; public static int ScoreVal3 = 60; public static void cleanData() { ScoreVal1 = 60; ScoreVal2 = 60; ScoreVal3 = 60; } public TMP_Text Val1; public TMP_Text Val2; public TMP_Text Val3; private void Awake() { Instance = this; } // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { } // Update is called once per frame void Update() { } public void UpdateScoreVals() { if (Val1) { Val1.text = ScoreVal1.ToString(); } if (Val2) { Val2.text = ScoreVal2.ToString(); } if (Val3) { Val3.text = ScoreVal3.ToString(); } } }