How do you make a level randomly load a skybox from a list?

Hello, Unity!

I was wondering how to make a script that would randomly load a level’s skybox from a predetermined list. The terrain of the level and the lighting would remain completely the same, but the skybox would be randomly loaded. For example, I have a skybox called Sunny 1 Skybox, and it would be loaded out of a list of different ones. Can somebody help me with the script? Any assistance is appreciated!

Thanks!

sethestuff

Hope You Are Looking For This…

using UnityEngine;

using System.Collections;

public class Test : MonoBehaviour {

	public Material[] skyBox;//SkyBox Materials..

	void Update()
	{
		if(Input.GetKeyDown(KeyCode.Mouse0))
		{
			RenderSettings.skybox=skyBox[Random.Range(0,skyBox.Length)];
		}
	}

}