Giter VIP home page Giter VIP logo

cardboard-controls's Introduction

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/CardboardSDK-Unity

What's added?

Google's SDK only has one hook into the magnet: 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:

  • Magnet down
  • Magnet up
  • Magnet click
  • Boolean if the magnet is held
  • Seconds magnet 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 working on iOS then you might want to look into replacing Google's SDK with rsanchezsaez's CardboardSDK-iOS. It ports the Android code to iOS with nearly feature parity.

If neither of those work, you might want to look into the Durovis Dive Plugin Package as a last resort. You will also not be able to use controls that rely on Google's API, such as the Raycast Gaze.

Usage

When you import this package, just add the CardboardControlManager prefab to the root of your scene. Now you can start using the API which is thoroughly documented in the DemoScene code.

cardboard-controls's People

Contributors

jscott avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.