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

34 lines
710 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class OffCeShi : MonoBehaviour
{
public Button CeShiButton;
public GameObject[] CeShiGameObject;
// Start is called before the first frame update
void Start()
{
CeShiButton.onClick.AddListener(Open);
}
public void Open()
{
if (CeShiGameObject[0].activeSelf)
{
foreach (var item in CeShiGameObject)
{
item.SetActive(false);
}
}
else
{
foreach (var item in CeShiGameObject)
{
item.SetActive(true);
}
}
}
}