Question by
USERNAME_NOT_FOUND · Aug 11, 2016 at 01:57 PM ·
uibuttonsceneswitch scenes
Button doesn't work and script doesn't switch Scenes
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
using UnityEditor.SceneManagement;
public class ButtonBehavior : MonoBehaviour {
public void onClick()
{
EditorSceneManager.OpenScene("Assets/FPS_BASE_STUFFS.unity");
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
This code was designed to load main scene when I click the button on the start scene. But if I press the button, it doesn't even be focused. And If I add the main scene into hierarchy then it becomes focused but it still doesn't switch scenes. I can't get where to fix first. please help
Comment