using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR.InteractionSystem;
using Valve.VR;
[RequireComponent(typeof(Interactable))]
public class PlayerGrab : MonoBehaviour
{
public SteamVR_Action_Boolean _gripAction = SteamVR_Input.GetAction<SteamVR_Action_Boolean>("GrabGrip");
public SteamVR_Input_Sources _sources = SteamVR_Input_Sources.Any;
[EnumFlags]
[Tooltip("The flags used to attach this object to the hand.")]
public Hand.AttachmentFlags attachmentFlags = Hand.defaultAttachmentFlags & (~Hand.AttachmentFlags.SnapOnAttach) & (~Hand.AttachmentFlags.DetachOthers) & (~Hand.AttachmentFlags.VelocityMovement);
protected Interactable _interactable;
private void Awake()
{
_interactable = this.GetComponent<Interactable>();
}
public virtual void HandHoverUpdate(Hand hand)
{
if (_interactable.
SteamVRPlugin.2.0 抓取物体
最新推荐文章于 2023-01-06 16:06:45 发布
本文详细介绍了如何利用SteamVRPlugin 2.0版本实现虚拟现实环境中对物体的抓取功能,涵盖了设置、交互逻辑以及优化技巧,帮助开发者创建更加真实的VR体验。
摘要由CSDN通过智能技术生成