This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
station_obscurum_unity/Assets/Packages/SpaceSkies Free/Demo/Scripts/SkyboxChanger.cs

20 lines
455 B
C#
Raw Normal View History

2023-04-17 06:22:07 +02:00
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];
}
}