Skip to content

sontitan/cardboard-controls

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cardboard Controls+

Cardboard Controls+ is all you need to develop the best Cardboard games in Unity. These scripts enhance Google's official Cardboard SDK for Unity with improvements such as discrete magnet control, raycast data, and event-driven architecture. Stop limiting your creative options!

Join the chat at https://gitter.im/JScott/cardboard-controls

Usage

You may experience problems if you import the code manually without using the provided unitypackage file.

What's added?

Google's SDK only has one hook into the trigger: bool CardboardTriggered. It's available for one frame that you have to waste cycles polling for. Instead of limiting yourself to that, you can now utilize C# methods and delegates for:

  • Trigger down
  • Trigger up
  • Trigger click
  • Boolean if the trigger is held
  • Seconds trigger held for

This expands your opportunities, allowing interactions like holding the magnet to move and clicking to interact to provide a more natural experience.

There are also methods and delegates for:

  • Tilting the device, as used in the official Cardboard app to navigate menus
  • Gaze raycasting, capturing what you look at and for how long

These helpers let you focus on what makes your game cool instead of boilerplate code.

Prerequisites

If you got this from the Asset Store then I've already packaged a version of the prerequisites for you.

If not then you'll need to import the base Cardboard SDK if you haven't already:

If you're having any trouble getting Google's Cardboard SDK set up, read through their excellent guide for getting started. Cardboard Controls+ has been tested against v0.5.1.

About

A complete and robust Cardboard Input SDK for Unity in C#

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%