I decided to use something else to launch and quit the game.
Button does'nt work
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class PlayButton : MonoBehaviour
{
public int Level0;
public void OnMouseUp()
{
SceneManager.LoadScene(Level0);
}
}
The button doesn't work in-build. The button is a sprite, maybe that has something to do with it?
On$$anonymous$$ouseDown & On$$anonymous$$ouseUp This event is sent to all scripts of the Collider or GUIElement.
Are you sure there is a collider on the button ?
Are you sure the click is detected ? (Debug.LogError to check in build with Developper mode enabled when building)
Are you sure the scene isin your build settings ?
For NGUI elements, add a custom event trigger ins$$anonymous$$d : https://docs.unity3d.com/ScriptReference/EventSystems.EventTrigger.html
FAQ :
Some reasons for getting a post rejected:
You haven't provided enough context: we need more information about your problem, relevant code snippets and what you have tried already.
Added Rigidbody2D collider. Still doesn't work. Scene is in build settings.
I quit. I'm going to just make it so pressing 1 launches the game and 2 quits.