Map selector
This commit is contained in:
23
Assets/Scripts/map selector script/SkyboxLoader.cs
Normal file
23
Assets/Scripts/map selector script/SkyboxLoader.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SkyboxLoader : MonoBehaviour
|
||||
{
|
||||
public Material skyboxDay;
|
||||
public Material skyboxNight;
|
||||
string skyboxToLoad;
|
||||
void Awake()
|
||||
{
|
||||
skyboxToLoad = GameObject.Find("SkyboxManager").GetComponent<TimeOfDay>().skyboxMaterial;
|
||||
Debug.Log("Skybox: " + skyboxToLoad);
|
||||
if (skyboxToLoad == "Day")
|
||||
{
|
||||
RenderSettings.skybox = skyboxDay;
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderSettings.skybox = skyboxNight;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user