It all works except it doesn’t get triggered in Run mode.
My script
using UnityEngine;
using UnityEngine.UI;
public class ChangeSkybox : MonoBehaviour
{
public Material Laon;
public Material skybox_pano;
public Material Bedna;
public void ChangeSkybox1()
{
Camera.main.GetComponent<Skybox> ().material = skybox_pano;
}
public void ChangeSkybox2()
{
Camera.main.GetComponent<Skybox>().material = Laon;
}
public void ChangeSkybox3()
{
Camera.main.GetComponent<Skybox>().material = Bedna;
}
}
Here you can see what I mean Imgur: The magic of the Internet
I have the functions attached to the button through the onclick