hey there,
i’ve been making a game and it’s almost finished.
so i added a main menu and if i compile it into a standalone app (to test out the quit button)
the app says powered by unity and then there’s a black screen and then it crashes.
this happens on mac and windows.
here is the start script that loads the level when pressed the start button
using UnityEngine;
using System.Collections;
public class Start: MonoBehaviour {
public void LoadLevel(int Index = 1)
{
Application.LoadLevel(Index = 1);
}
}
and here’s the quit script that quits the application when th quit button is pressed.
using UnityEngine;
using System.Collections;
public class Quit : MonoBehaviour {
public void ExitApplication()
{
ExitApplication();
}
}
i’ve tried application.quit
but that gives the same result… a crash
so this works in the editor but as a standalone application it crashes.
edit: i changed the start code it’s this now and it still crashes
using UnityEngine;
using System.Collections;
public class Start: MonoBehaviour {
public void NextLevelButton()
{
Application.LoadLevel("game");
}
}