This repository has been archived on 2026-01-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Frontec/Assets/Scripts/VR/LocomotionController.cs
jmaniuvc 2936c48466 Frontec
2025-02-24 12:12:52 +09:00

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;
}
}