Даа, ебать его рот блять сука, втянули нахуй в какую-то хуйню
This commit is contained in:
46
Assets/measuregeneric/scripts/Areaportal.cs
Normal file
46
Assets/measuregeneric/scripts/Areaportal.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon;
|
||||
|
||||
public class Areaportal : UdonSharpBehaviour
|
||||
{
|
||||
private OcclusionPortal portal;
|
||||
|
||||
private GameObject[] imposters;
|
||||
|
||||
void Start()
|
||||
{
|
||||
this.portal = this.GetComponent<OcclusionPortal>();
|
||||
this.imposters = new GameObject[this.transform.childCount];
|
||||
|
||||
// Ёбаный рот этого UdonSharp
|
||||
int i = 0;
|
||||
foreach(Transform child in this.transform)
|
||||
{
|
||||
this.imposters[i++] = child.gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnPlayerTriggerEnter(VRCPlayerApi player)
|
||||
{
|
||||
this.portal.open = true;
|
||||
|
||||
foreach(GameObject imposter in this.imposters)
|
||||
{
|
||||
imposter.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnPlayerTriggerExit(VRCPlayerApi player)
|
||||
{
|
||||
this.portal.open = false;
|
||||
|
||||
foreach(GameObject imposter in this.imposters)
|
||||
{
|
||||
imposter.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user