Cute_demon_attacks/meng_yao/Assets/script/Manager/UIScreenMgr.cs
2024-10-30 01:08:16 +08:00

41 lines
809 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using UnityEngine.SceneManagement;
public class UIScreenMgr : MonoBehaviour
{
public static UIScreenMgr instance;
public GameObject[] screens;
// Start is called before the first frame update
void Start()
{
ShowScreen(JumpScene.jumpbool);
instance = this;
}
public void ShowScreen(int index)
{
// 隐藏所有界面
foreach (GameObject screen in screens)
{
screen.SetActive(false);
}
// 显示指定的界面
if (index >= 0 && index < screens.Length)
{
screens[index].SetActive(true);
}
}
// Update is called once per frame
void Update()
{
}
}