Replace UltimateXR with HurricaneVR
This commit is contained in:
34
Assets/HurricaneVR/TechDemo/Scripts/DemoManualTeleport.cs
Normal file
34
Assets/HurricaneVR/TechDemo/Scripts/DemoManualTeleport.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Linq;
|
||||
using HurricaneVR.Framework.Core.Player;
|
||||
using UnityEngine;
|
||||
|
||||
namespace HurricaneVR.TechDemo.Scripts
|
||||
{
|
||||
public class DemoManualTeleport : MonoBehaviour
|
||||
{
|
||||
public Transform PositionOne;
|
||||
public Transform PositionTwo;
|
||||
public HVRTeleporter Teleporter { get; set; }
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Teleporter = GameObject.FindObjectsOfType<HVRTeleporter>().FirstOrDefault(e => e.gameObject.activeInHierarchy);
|
||||
}
|
||||
|
||||
public void GoToOne()
|
||||
{
|
||||
if (Teleporter && PositionOne)
|
||||
{
|
||||
Teleporter.Teleport(PositionOne.position, PositionOne.forward);
|
||||
}
|
||||
}
|
||||
|
||||
public void GoToTwo()
|
||||
{
|
||||
if (Teleporter && PositionTwo)
|
||||
{
|
||||
Teleporter.Teleport(PositionTwo.position, PositionTwo.forward);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user