Map selector done
This commit is contained in:
@@ -10,7 +10,6 @@ public class SkyboxLoader : MonoBehaviour
|
||||
void Awake()
|
||||
{
|
||||
skyboxToLoad = GameObject.Find("SkyboxManager").GetComponent<TimeOfDay>().skyboxMaterial;
|
||||
Debug.Log("Skybox: " + skyboxToLoad);
|
||||
if (skyboxToLoad == "Day")
|
||||
{
|
||||
RenderSettings.skybox = skyboxDay;
|
||||
|
||||
@@ -6,23 +6,43 @@ using TMPro;
|
||||
|
||||
public class TimeOfDay : MonoBehaviour
|
||||
{
|
||||
public string skyboxMaterial = "not selected";
|
||||
public GameObject DayLight;
|
||||
public GameObject NightLight;
|
||||
public string skyboxMaterial = "Night";
|
||||
public Material DaySkybox;
|
||||
public Material NightSkybox;
|
||||
public GameObject[] Lights;
|
||||
|
||||
public static TimeOfDay Instance;
|
||||
public TextMeshProUGUI MainText;
|
||||
void DisableAllLights()
|
||||
{
|
||||
foreach (GameObject light in Lights)
|
||||
{
|
||||
light.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeToDayTime()
|
||||
{
|
||||
NightLight.SetActive(false);
|
||||
RenderSettings.skybox = DaySkybox;
|
||||
DayLight.SetActive(true);
|
||||
skyboxMaterial = "Day";
|
||||
}
|
||||
public void ChangeToNightTime()
|
||||
{
|
||||
skyboxMaterial = "Night";
|
||||
DayLight.SetActive(false);
|
||||
RenderSettings.skybox = NightSkybox;
|
||||
NightLight.SetActive(true);
|
||||
skyboxMaterial = "Night"; ;
|
||||
}
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
DisableAllLights();
|
||||
NightLight.SetActive(true);
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user