NG_/Assets/Scripts/UI/全局/GlobalSchema.cs

35 lines
663 B
C#
Raw Normal View History

2024-12-13 19:40:05 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GlobalSchema : MonoBehaviour
{
public List<GameObject> globalObjects;
// Start is called before the first frame update
private void OnEnable()
{
StartCoroutine(global());
}
private IEnumerator global()
{
while (true)
{
yield return new WaitForSeconds(120f);
foreach (GameObject obj in globalObjects)
{
obj.SetActive(!obj.activeSelf);
}
}
}
// Update is called once per frame
void Update()
{
}
}