32 lines
638 B
C#
32 lines
638 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
|
|
public class TimeOfDay : MonoBehaviour
|
|
{
|
|
public string skyboxMaterial;
|
|
|
|
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;
|
|
}
|
|
}
|