NG_/Assets/Scripts/UI/数据框/TFBoxActive.cs

26 lines
518 B
C#
Raw Permalink Normal View History

2024-12-13 19:40:05 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TFBoxActive : MonoBehaviour
{
public List<GameObject> TFBoxes;
public void OnEnable()
{
foreach (GameObject tfBox in TFBoxes)
{
tfBox.GetComponent<BoxCollider>().enabled = false;
}
}
public void OnDisable()
{
foreach (GameObject tfBox in TFBoxes)
{
tfBox.GetComponent<BoxCollider>().enabled = true;
}
}
}