Classes | Static Attributes | Properties | List of all members
Headjack.VRInput Class Reference
Inheritance diagram for Headjack.VRInput:

Classes

class  VrButton
 Button class, Confirm and Back are universal across all platforms More...
 

Static Attributes

static VrButton Back = new VrButton()
 VR Back button More...
 
static VrButton Confirm = new VrButton()
 VR Input button More...
 
static bool MotionControllerLaser
 Show the laser of the motion controller More...
 

Properties

static Transform LaserTransform [get]
 Get the transform of the motion controller laser (if available) More...
 
static bool MotionControllerAvailable [get]
 Check if a motion controller is connected More...
 
static Color MotionControllerColor [get, set]
 The color of the laser pointer, can be set or get More...
 
static bool MotionControllerShow [get, set]
 Show the motion controller, it will be glass/seethrough if false More...
 

Member Data Documentation

§ Back

VrButton Headjack.VRInput.Back = new VrButton()
static

VR Back button

Note
Escape button - Android back button - Oculus Remote Return - Gear VR Back button - Vive Menu button

Example

public void CheckIfClickedOnMe()
{
if (App.IsCrosshairHit(gameObject))
{
if (VRInput.Confirm.Pressed)
{
print("Clicked on me!");
}
}
}

§ Confirm

VrButton Headjack.VRInput.Confirm = new VrButton()
static

VR Input button

Note
Left mouse button - Space - Screen tap - Oculus Remote Confirm - Gear VR touchpad tap - Vive Trigger

Example

public void CheckIfClickedOnMe()
{
if (App.IsCrosshairHit(gameObject))
{
if (VRInput.Confirm.Pressed)
{
print("Clicked on me!");
}
}
}

§ MotionControllerLaser

bool Headjack.VRInput.MotionControllerLaser
static

Show the laser of the motion controller

Example

public void ShowLaserWhenHoldingTrigger()
{
if (VRInput.Confirm.Hold)
{
VRInput.MotionControllerLaser=true;
}else
{
VRInput.MotionControllerLaser=false;
}
}

Property Documentation

§ LaserTransform

Transform Headjack.VRInput.LaserTransform
staticget

Get the transform of the motion controller laser (if available)

Example

public void GameObjectToLaserPosition(GameObject target)
{
target.transform.position = Headjack.VRInput.LaserTransform.position;
}

§ MotionControllerAvailable

bool Headjack.VRInput.MotionControllerAvailable
staticget

Check if a motion controller is connected

Returns
True if a motion controller is connected

§ MotionControllerColor

Color Headjack.VRInput.MotionControllerColor
staticgetset

The color of the laser pointer, can be set or get

Returns
Current color of the motion controller laser

§ MotionControllerShow

bool Headjack.VRInput.MotionControllerShow
staticgetset

Show the motion controller, it will be glass/seethrough if false

Example

public void ShowControllerWhenHoldingTrigger()
{
if (VRInput.Confirm.Hold)
{
VRInput.MotionControllerShow=true;
}else
{
VRInput.MotionControllerShow=false;
}
}

The documentation for this class was generated from the following file: