ar_tourism_flutter_unity/unity/VRProject2/Assets/zhl/zhlScripts/ChangSence.cs
2025-05-14 17:04:13 +08:00

28 lines
729 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ChangSence : MonoBehaviour
{
public Button thisbutton;
// Start is called before the first frame update
void Start()
{
thisbutton.onClick.AddListener(Change);
}
// Update is called once per frame
void Change()
{
if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex == 0)
{
UnityEngine.SceneManagement.SceneManager.LoadScene(1);
}
else if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex == 1)
{
UnityEngine.SceneManagement.SceneManager.LoadScene(0);
}
}
}