namespace ChivaXR.VR { using UnityEngine; #region 按键枚举 public enum CVR_ButtonPressTypes { /// /// The button is currently being pressed. /// Press, /// /// The button has just been pressed down. /// PressDown, /// /// The button has just been released. /// PressUp, /// /// The button is currently being touched. /// Touch, /// /// The button has just been touched. /// TouchDown, /// /// The button is no longer being touched. /// TouchUp } public enum CVR_ButtonTypes { /// /// Button One on the controller. /// ButtonOne, /// /// Button Two on the controller. /// ButtonTwo, /// /// Grip on the controller. /// Grip, /// /// Grip Hairline on the controller. /// GripHairline, /// /// Start Menu on the controller. /// StartMenu, /// /// Trigger on the controller. /// Trigger, /// /// Trigger Hairline on the controller. /// TriggerHairline, /// /// Touchpad on the controller. /// Touchpad, /// /// Touchpad Two on the controller. /// TouchpadTwo, /// /// Middle Finger on the controller. /// MiddleFinger, /// /// Ring Finger on the controller. /// RingFinger, /// /// Pinky Finger on the controller. /// PinkyFinger } /// /// Controller hand reference. /// public enum CVR_ControllerHand { /// /// No hand is assigned. /// None, /// /// The left hand is assigned. /// Left, /// /// The right hand is assigned. /// Right } #endregion /// /// CVR交互接口(ChivaVR) /// public interface IVR_Interactable { /// /// 工具类型 /// /// CVR_ToolType GetToolType(); /// /// 是否处于抓取状态 /// /// bool CVR_IsGrabbed(); /// /// 是否处于使用状态 /// /// bool CVR_IsUsing(); /// /// 断开使用状态 /// /// void ForceStopUsing(); /// /// 获取当前手柄手部类型(左右) /// /// CVR_ControllerHand CVR_GetCurrentHand(); /// /// 检测手柄按钮状态 /// /// /// /// bool CVR_CheckButtonState(CVR_ButtonTypes btnType, CVR_ButtonPressTypes pressType); Vector2 CVR_GetControllerAxis(CVR_ButtonTypes btnType); /// /// 获取当前手部脚本Object /// /// GameObject CVR_GetInteractableObject(); /// /// 获取当前物体GameObject /// /// GameObject CVR_GetCurrentObject(); /// /// 获取VR摄像机 /// /// GameObject CVR_GetHeadsetCamera(); /// /// 当前物体被拾取时 /// event CVR_InteractableObjectEventHandler CVR_InteractableObjectGrabbed; /// /// 当前物体松手前 /// event CVR_InteractableObjectEventHandler CVR_InteractableObjectPreUnGrabbed; /// /// 当前物体点击使用时 /// event CVR_InteractableObjectEventHandler CVR_InteractableObjectUsed; /// /// 当前物体退出使用时 /// event CVR_InteractableObjectEventHandler CVR_InteractableObjectUnused; } public struct CVR_InteractableObjectEventArgs { public GameObject interactingObject; } /// /// Event Payload /// /// this object /// public delegate void CVR_InteractableObjectEventHandler(object sender, CVR_InteractableObjectEventArgs e); }