Map selector
This commit is contained in:
31
Assets/Scripts/map selector script/TimeOfDay.cs
Normal file
31
Assets/Scripts/map selector script/TimeOfDay.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user