i have attached this script to a a button OnClick function and it should load “main” scene but it unable to stay at the main scene. it loads it first and then reloads it agian.
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
public void Restart()
{
Application.LoadLevel ("main");
}
}