Added auto-portal script
This commit is contained in:
8
Assets/measuregeneric/scripts.meta
Normal file
8
Assets/measuregeneric/scripts.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ccf1a20da4019c2419c4bb0337181e3b
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
27
Assets/measuregeneric/scripts/Autoportal.cs
Normal file
27
Assets/measuregeneric/scripts/Autoportal.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/measuregeneric/scripts/Autoportal.cs.meta
Normal file
11
Assets/measuregeneric/scripts/Autoportal.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1bf6953a4b6dabc47a2e8dc7678d7a41
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Reference in New Issue
Block a user