I have two scripts. This one:
using UnityEngine;
using System.Collections;
public class QuitOnClick : MonoBehaviour {
public void Quit()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
}
when I add it to a button I can add an element in the On Click () whateveritiscalled and tell it to “QuitOnClick.Quit”.
But this script:
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class LoadScene : MonoBehaviour {
public int sceneIndex = 1;
public void Load()
{
SceneManager.LoadScene(sceneIndex);
}
}
Doesn’t give me the same option, despite being almost exactly the same.