using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; public class textRoading : MonoBehaviour { public bool Is; public Button BTN; // Start is called before the first frame update void Start() { BTN.onClick.AddListener(OnBTN); } // Update is called once per frame void OnBTN() { if (Is) { Debug.Log(Is); SceneManager.LoadScene(JumpScene.main_scene); return; } Debug.Log(Is); } }