using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class TimeOfDay : MonoBehaviour { public string skyboxMaterial = "not selected"; public static TimeOfDay Instance; public TextMeshProUGUI MainText; public void ChangeToDayTime() { skyboxMaterial = "Day"; } public void ChangeToNightTime() { skyboxMaterial = "Night"; } private void Awake() { Instance = this; DontDestroyOnLoad(gameObject); } private void Update() { MainText.text = "Selected time of day: \n" + skyboxMaterial; } }