Files
vrc-measuregeneric-world/Assets/measuregeneric/scripts/Autoportal.cs
2024-11-28 04:13:30 +05:00

28 lines
550 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Autoportal : MonoBehaviour
{
public GameObject imposter;
private OcclusionPortal portal;
void Start()
{
this.portal = this.GetComponent<OcclusionPortal>();
}
private void OnTriggerEnter(Collider other)
{
this.portal.open = true;
this.imposter.SetActive(false);
}
private void OnTriggerExit(Collider other)
{
this.portal.open = false;
this.imposter.SetActive(true);
}
}