diff --git a/Assets/measuregeneric/scripts/Autoportal.cs b/Assets/measuregeneric/scripts/Autoportal.cs index 1186d04..20b9a37 100644 --- a/Assets/measuregeneric/scripts/Autoportal.cs +++ b/Assets/measuregeneric/scripts/Autoportal.cs @@ -4,24 +4,38 @@ using UnityEngine; public class Autoportal : MonoBehaviour { - public GameObject imposter; + private List imposters; private OcclusionPortal portal; void Start() { this.portal = this.GetComponent(); + this.imposters = new List(); + + foreach(Transform child in this.transform) + { + this.imposters.Add(child.gameObject); + } } private void OnTriggerEnter(Collider other) { this.portal.open = true; - this.imposter.SetActive(false); + + foreach(GameObject imposter in this.imposters) + { + imposter.SetActive(false); + } } private void OnTriggerExit(Collider other) { this.portal.open = false; - this.imposter.SetActive(true); + + foreach(GameObject imposter in this.imposters) + { + imposter.SetActive(true); + } } }