/
crypt
/
NumbersPlay
Обзор
Документация
Войти
/
crypt
/
NumbersPlay
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Assets/PluginYourGames/Example/Scripts/Scenes/DemoSceneLoadButton.cs
32 строки
763 B
Crypt
start
16 ноя 2025, 14:28
16 ноя 2025, 14:28
1482007
Код
Авторство
О чём код?
using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.SceneManagement; using UnityEngine.UI; namespace YG.Example.DemoScene { public class DemoSceneLoadButton : MonoBehaviour { public string sceneName; public Text textButton; public void Setup(string sceneName) { this.sceneName = sceneName; textButton.text = sceneName; gameObject.name = sceneName; } public void LoadScene() { if (!string.IsNullOrEmpty(sceneName)) { SceneManager.LoadScene(sceneName); } else { Debug.LogError("Scene name is empty, cannot load scene."); } } } }