Cute_demon_attacks/meng_yao/Assets/script/scene_Main/qiehuanScenes.cs

78 lines
1.7 KiB
C#
Raw Normal View History

2024-11-12 17:41:06 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class qiehuanScenes : MonoBehaviour
{
[Header("<22><>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>һһ<D2BB><D2BB>Ӧ")]
public Button btn1;
public Button btn2;
public Button btn3;
public Button btn4;
public Button btn5;
[Header("<22><>Ӧ<EFBFBD>ij<EFBFBD><C4B3><EFBFBD>")]
public GameObject scene1;
public GameObject scene2;
public GameObject scene3;
public GameObject scene4;
public GameObject scene5;
[Header("<22><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>")]
public GameObject nowScene;
// Start is called before the first frame update
void Awake()
{
btn1.onClick.AddListener(()=> {
if (scene1== nowScene)
{
return;
}
scene1.SetActive(true);
this.nowScene.SetActive(false);
});
btn2.onClick.AddListener(()=> {
if (scene2 == nowScene)
{
return;
}
scene2.SetActive(true);
this.nowScene.SetActive(false);
});
btn3.onClick.AddListener(()=> {
if (scene3 == nowScene)
{
return;
}
scene3.SetActive(true);
this.nowScene.SetActive(false);
});
btn4.onClick.AddListener(()=> {
if (scene4 == nowScene)
{
return;
}
scene4.SetActive(true);
this.nowScene.SetActive(false);
});
btn5.onClick.AddListener(()=> {
if (scene5 == nowScene)
{
return;
}
scene5.SetActive(true);
this.nowScene.SetActive(false);
});
}
}