Initial commit

This commit is contained in:
Thorbjoern
2025-05-26 00:46:28 +02:00
commit e5bca03433
3896 changed files with 1434297 additions and 0 deletions
@@ -0,0 +1,31 @@
using System;
using UnityEngine;
namespace XRMultiplayer
{
/// <summary>
/// A simple class used for callbacks when OnTriggerEnter or OnTriggerExit is called.
/// </summary>
[RequireComponent(typeof(Collider))]
public class SubTrigger : MonoBehaviour
{
public Action<Collider, bool> OnTriggerAction;
public Collider subTriggerCollider;
private void Awake()
{
if (subTriggerCollider == null)
TryGetComponent(out subTriggerCollider);
}
private void OnTriggerEnter(Collider other)
{
OnTriggerAction?.Invoke(other, true);
}
private void OnTriggerExit(Collider other)
{
OnTriggerAction?.Invoke(other, false);
}
}
}