1
0
forked from cgvr/DeltaVR
Files
DeltaVR3DModelGeneration/Assets/_PROJECT/Scripts/ModeGeneration/ArcheryRange/MicrophoneProximityTrigger.cs

28 lines
689 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")
{
Debug.Log("collided with: " + other.gameObject.name);
mic.OnPlayerApproach();
}
}
private void OnTriggerExit(Collider other)
{
if (!isEnter && other.gameObject.tag == "Player Head")
{
Debug.Log("collider left with: " + other.gameObject.name);
mic.OnPlayerLeave();
}
}
}