(サンプルコード)
using UnityEngine;
public class ShieldBreak : MonoBehaviour
{
private GameObject[] poles;
public GameObject shield;
void Update()
{
poles = GameObject.FindGameObjectsWithTag("Pole");
if (poles.Length == 0)
{
Destroy(shield.gameObject);
}
}
}
(実行結果)