1234567891011121314151617181920212223242526272829303132 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class TestLuJing : MonoBehaviour
- {
-
- public List<GameObject> list_luJing;
- public float interval = 1;
- float times = 0;
- int Index = 0;
- // Update is called once per frame
- void Update()
- {
- times += Time.deltaTime;
- if(times>interval)
- {
- times = 0;
- Index = Index % list_luJing.Count;
- for (int i = 0; i < list_luJing.Count; i++)
- {
- list_luJing[i].SetActive(false);
- }
- list_luJing[Index++].SetActive(true);
- }
- }
- }
|