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.
44 lines
866 B
44 lines
866 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class AllPanDing : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
public GameObject[] gameObjects;
|
|
public bool[] bos;
|
|
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== bos[i])
|
|
{
|
|
id++;
|
|
}
|
|
|
|
}
|
|
if (id == gameObjects.Length)
|
|
{
|
|
panDuan.选项[panDuan.index] = true;
|
|
}
|
|
else
|
|
{
|
|
panDuan.选项[panDuan.index] = false;
|
|
}
|
|
|
|
}
|
|
|
|
}
|