Tanoda
VRInput.cs
Go to the documentation of this file.
1
using
System.Collections;
2
using
System.Collections.Generic;
3
using
UnityEngine
;
4
using
UnityEngine
.
EventSystems
;
5
using
UnityEngine
.
Events
;
6
#if !UNITY_WEBGL
7
using
Valve.VR;
8
#endif
9
10
public
class
VRInput
: BaseInput
11
{
12
#if !UNITY_WEBGL
13
public
Camera
eventCamera
=
null
;
14
public
SteamVR_Action_Boolean
clickButton
= SteamVR_Input.GetAction<SteamVR_Action_Boolean>(
"InteractUI"
);
15
16
protected
override
void
Awake
()
17
{
18
GetComponent<BaseInputModule>().inputOverride =
this
;
19
}
20
21
public
override
bool
GetMouseButton
(
int
button)
22
{
23
return
clickButton
.state;
24
}
25
26
public
override
bool
GetMouseButtonDown
(
int
button)
27
{
28
return
clickButton
.stateDown;
29
}
30
31
public
override
bool
GetMouseButtonUp
(
int
button)
32
{
33
return
clickButton
.stateUp;
34
}
35
36
public
override
Vector2
mousePosition
37
{
38
get
39
{
40
return
new
Vector2(
eventCamera
.pixelWidth / 2,
eventCamera
.pixelHeight / 2);
41
}
42
}
43
#endif
44
}
VRInput
Definition:
VRInput.cs:11
VRInput.Awake
override void Awake()
Definition:
VRInput.cs:16
VRInput.GetMouseButtonDown
override bool GetMouseButtonDown(int button)
Definition:
VRInput.cs:26
VRInput.clickButton
SteamVR_Action_Boolean clickButton
Definition:
VRInput.cs:14
VRInput.mousePosition
override Vector2 mousePosition
Definition:
VRInput.cs:37
VRInput.GetMouseButtonUp
override bool GetMouseButtonUp(int button)
Definition:
VRInput.cs:31
VRInput.GetMouseButton
override bool GetMouseButton(int button)
Definition:
VRInput.cs:21
VRInput.eventCamera
Camera eventCamera
Definition:
VRInput.cs:13
UnityEngine.EventSystems
Definition:
AimerInputModule.cs:5
UnityEngine.Events
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
Scripts
Pointer
VRInput.cs
Generated by
1.9.3