DeltaVR/Assets/TeleportationProviderSetter.cs
2023-05-08 15:56:10 +03:00

23 lines
758 B
C#

using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class TeleportationProviderSetter : MonoBehaviour
{
// hack script
void Awake()
{
Debug.Log("Hack: Overwriting all teleport area providers in scene");
TeleportationProvider provider = GetComponent<TeleportationProvider>();
TeleportationArea[] teleportationAreas = FindObjectsOfType<TeleportationArea>();
foreach (var area in teleportationAreas)
{
area.teleportationProvider = provider;
}
TeleportationAnchor[] teleportationAnchors = FindObjectsOfType<TeleportationAnchor>();
foreach (var anchor in teleportationAnchors)
{
anchor.teleportationProvider = provider;
}
}
}