Files
racesm/Assets/Scripts/map selector script/TimeOfDay.cs
2024-04-25 15:08:17 +02:00

32 lines
655 B
C#

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;
}
}