You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
837 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AllEndPanDing : MonoBehaviour
{
// Start is called before the first frame update
public GameObject[] gameObjects;
private PanDuan panDuan;
void Start()
{
panDuan = GetComponent<PanDuan>();
}
// Update is called once per frame
void Update()
{
PanDing();
}
void PanDing()
{
int id = 0;
for (int i = 0; i < gameObjects.Length; i++)
{
if (gameObjects[i].activeSelf)
{
id++;
}
}
if (id == gameObjects.Length)
{
panDuan.[panDuan.index] = true;
}
else
{
panDuan.[panDuan.index] = false;
}
}
}