Files
racesm/Assets/Scripts/map selector script/SkyboxLoader.cs
PokingPines 06756d418a Map selector
2024-04-25 12:57:44 +02:00

23 lines
571 B
C#

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