//UnityEditor 관련 코드는 빌드 할 때 없애 줘야함

UnityEditor.EditorApplication.isPlaying = false;    //빌드 전 게임 종료
Application.Quit(); //빌드 후 게임 종료