using System.Collections; using System.Collections.Generic; using UnityEngine; public class ForcibleEntryCheck : MonoBehaviour { public ForcibleEntryCtrl fec; private void Awake() { fec = GetComponentInParent(); } private void OnTriggerEnter(Collider other) { if (other.gameObject.GetComponent()) { if (!fec.FireManOnRightPos.Contains(other.gameObject)) { fec.FireManOnRightPos.Add(other.gameObject); } } } private void OnTriggerExit(Collider other) { if (other.gameObject.GetComponent()) { if (fec.FireManOnRightPos.Contains(other.gameObject)) { fec.FireManOnRightPos.Remove(other.gameObject); } } } }