Default/imported scripts missing
Hi guys,
When adding an onclick event to my button on my canvas I get these options:
What I want to see is this:
But the "LoadSceneOnClick" option doesn't even exist in my unity, I have searched high and low and I have found others that also have this option, otherwise I have to script every single one of those items manually? Is there no easier way?
I'm using 5.6 on the machine in the picture, but my other machine uses 5.0 and also doesn't have the option, the tutorial that shows the "LoadSceneOnClick" option is also in unity 5 and doesn't even mention scripting this function, it just tells me to add it as if it has to be there by default.
Pleasre help.
Answer by UnityCoach · Aug 18, 2017 at 12:19 AM
This isn't there by default, you have to script it. Something in the like :
using UnityEngine.SceneManagement;
public class LoadSceneOnClick : MonoBehaviour
{
public void LoadScene (int scene)
{
SceneManager.LoadScene (scene);
}
}
Your answer
