Firstborn/Assets/SpaceSkies Free/Demo/Scripts/SkyboxChanger.cs

20 lines
455 B
C#
Raw Normal View History

using UnityEngine;
using UnityEngine.UI;
public class SkyboxChanger : MonoBehaviour
{
public Material[] Skyboxes;
private Dropdown _dropdown;
public void Awake()
{
_dropdown = GetComponent<Dropdown>();
//var options = Skyboxes.Select(skybox => skybox.name).ToList();
//_dropdown.AddOptions(options);
}
public void ChangeSkybox()
{
RenderSettings.skybox = Skyboxes[_dropdown.value];
}
}