Skip to content

Instantly share code, notes, and snippets.

@naojitaniguchi
Created November 26, 2022 02:50
Show Gist options
  • Save naojitaniguchi/4797adffdd63ed46f220f0a6333c2740 to your computer and use it in GitHub Desktop.
Save naojitaniguchi/4797adffdd63ed46f220f0a6333c2740 to your computer and use it in GitHub Desktop.
Load scene by clicking UI button in Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class ButtonPushNextScene : MonoBehaviour
{
public string nextScene;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void buttonPushed()
{
SceneManager.LoadScene(nextScene);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment