I would like to make it so that my game has three different skybox options and when you click a GUI button it changes the skybox to the skybox material you chose. Is this possible?
1 Answer
1var sky1 : Material;
var sky2 : Material;
var sky3 : Material;
function OnGUI () {
if(GUILayout.Button ("Sky 1"))
{
RenderSettings.skybox = sky1;
}
if(GUILayout.Button ("Sky 2"))
{
RenderSettings.skybox = sky2;
}
if(GUILayout.Button ("Sky 3"))
{
RenderSettings.skybox = sky3;
}
}
You can change the skybox material using RenderSettings.skybox=someMaterial; so I would assume you could just call this when the skybox selection has been chosen
– christinam