forked from cgvr/DeltaVR
26 lines
552 B
C#
26 lines
552 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class MicrophoneProximityTrigger : MonoBehaviour
|
|
{
|
|
public MicrophoneStand mic;
|
|
public bool isEnter;
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (isEnter && other.gameObject.tag == "Player Head")
|
|
{
|
|
mic.OnPlayerApproach();
|
|
}
|
|
}
|
|
|
|
private void OnTriggerExit(Collider other)
|
|
{
|
|
if (!isEnter && other.gameObject.tag == "Player Head")
|
|
{
|
|
mic.OnPlayerLeave();
|
|
}
|
|
}
|
|
}
|