35 lines
663 B
C#
35 lines
663 B
C#
|
|
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()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|