Wave: A Unity Asset Library
We want mobile gaming to be a more immersive and interactive experience, so we designed Wave. It's an open source Unity game engine Asset that makes 2 game dev features tremendously more accessible: elements of motion tracking for character control and real-time audio streaming between multiple devices. Check out a 2-minute demo video here.
Table of Contents
Prerequisites
Getting Started
Gyroscopic Camera Controller
Translational Movement with Accelerometer
Real Time Audio
Assets Directory
Contribute
Team
Prerequisites
- Unity 5
- Windows: 7 SP1+, 8, 10
- iOS: Mac OSX 10.8+ with Xcode
- Android: Android SDK
Getting Started
To use a phone with the Unity editor, * Download Unity Remote 4 from the app store. * In the Unity editor menubar, visit Edit > Project settings > Editor. * Under Unity Remote, change the tab pulldown to match your mobile device. iPhones are good to go! * Android users -- you still have more to configure for unity remote. Find any of the tutorials on google. Setting up Unity Remote
* Fork the repo, and navigate to the Assets/Scripts directory of the master branch. * Select the appropriate files. For example, cameraController.js for the gyroscopic camera features. * Include them within the Assets folder of your Unity library. Environment Configuration
Gyroscopic Camera Controller
![alt tag]( http://res.cloudinary.com/jjcodepen/image/upload/v1468705961/GyroscopeController_mu7qac.gif) In the GIF above, we're setting up an environment to use a mobile phone's gyroscope to control the in-game camera. Get started by following the steps below: * All logic is located inside the cameraController.js script. Make sure it's within the Assets folder of your Unity library. * Select the Main Camera object in your scene. * Add our Camera Controller script as a component in the inspector panel. * Drag a player object into the Camera Controller component.Translational Movement with Accelerometer
![alt tag]( http://res.cloudinary.com/jjcodepen/image/upload/v1469215988/Accelerometer_oh2uj8.gif) The idea of this feature is that when you move in the physical world, your in-game character moves as well. Using information from the mobile phone's accelerometer, we attempt to simulate walking movements in the Unity game engine. It's still experimental, but it works and may require tweaking depending on the mobile phone. Get started by following the steps below: * All logic is located inside the playerController.js script. Make sure it's within the Assets folder of your Unity library. * Select the Player object in your scene. * Add our Player Controller script as a component in the inspector panel. * Drag a player object into the Camera Controller component.Real-Time Audio
Allows you to talk with your mates by providing a way to transmit your voice across a multiplayer network.To get started you'll want to add the following things to any game object you want to be able to talk in real-time:
- AudioSource object
- VoiceController.cs
Currently, our audio feature is configured to only work with Unity's networking through their HLAPI and was written with Unity 5 in mind. To see an example of this feature being used with the HLAPI check out the 'demo' branch of this repository.
Configurable Options:
- Compression (defaults to Zlib)
- Recording Frequency (defaults to 16000Hz)
- Packet Sizes ...everything really
We provide multiple compression options such as: Zlib, Opus, NSpeex, and Snappy.
It's easy to adjust any of the settings you desire for your game. Just go to the VoiceController.cs script and change the variables at the top of the file. For example, if you want to record at higher frequencies, then just change the recordFrequency variable.