Files
racesm/Assets/Scripts/map selector script/SkyboxLoader.cs
2024-04-26 09:26:50 +02:00

22 lines
525 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;
if (skyboxToLoad == "Day")
{
RenderSettings.skybox = skyboxDay;
}
else
{
RenderSettings.skybox = skyboxNight;
}
}
}