32 lines
789 B
C#
32 lines
789 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.XR.Interaction.Toolkit;
|
|
|
|
public class LocomotionController : MonoBehaviour
|
|
{
|
|
public XRController rightTeleportRay;
|
|
public InputHelpers.Button teleportActivationButton;
|
|
public float activationThreshold = 0.1f;
|
|
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if(rightTeleportRay)
|
|
{
|
|
rightTeleportRay.gameObject.SetActive(ChectIfActivated(rightTeleportRay));
|
|
}
|
|
}
|
|
|
|
public bool ChectIfActivated(XRController controller)
|
|
{
|
|
InputHelpers.IsPressed(controller.inputDevice, teleportActivationButton, out bool isActivated, activationThreshold);
|
|
return isActivated;
|
|
}
|
|
}
|