mirror of
https://github.com/Project-Redacted/project-hampter.git
synced 2025-05-28 22:33:15 +00:00
20 lines
No EOL
404 B
C#
20 lines
No EOL
404 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class ButtonScript : MonoBehaviour
|
|
{
|
|
public Button yourButton;
|
|
public string nextSceneName;
|
|
void Start()
|
|
{
|
|
Button button = yourButton.GetComponent<Button>();
|
|
button.onClick.AddListener(OnClick);
|
|
}
|
|
|
|
void OnClick()
|
|
{
|
|
SceneManager.LoadScene(nextSceneName); // load the next scene
|
|
}
|
|
} |