14 lines
308 B
C#
14 lines
308 B
C#
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
|
|
public class ButtonToScene : MonoBehaviour {
|
|
public string sceneName;
|
|
|
|
void Awake() {
|
|
gameObject.GetComponent<Button>().onClick.AddListener(() => {
|
|
SceneManager.LoadScene(sceneName);
|
|
});
|
|
}
|
|
}
|