42 lines
909 B
C#
42 lines
909 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.InputSystem.XR;
|
|
|
|
public class RightHand : MonoBehaviour
|
|
{
|
|
public TrackedPoseDriver tracked;
|
|
|
|
public GameObject model;
|
|
// 射线
|
|
public LayerMask layerMask;
|
|
public Transform ray;
|
|
|
|
public void Start()
|
|
{
|
|
//tracked.enabled = true;
|
|
Hide();
|
|
// MRInput.Ins.RegisterClickRrightTrigger(ClickRrightTrigger);
|
|
// InitWeapon();
|
|
}
|
|
|
|
public void Show()
|
|
{
|
|
ray.gameObject.SetActive(true);
|
|
model.gameObject.SetActive(true);
|
|
}
|
|
|
|
public void Hide()
|
|
{
|
|
ray.gameObject.SetActive(false);
|
|
model.gameObject.SetActive(false);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
transform.position = GameInit.Ins.self.RightHand.position;
|
|
transform.rotation = GameInit.Ins.self.RightHand.rotation;
|
|
}
|
|
}
|