Book Image

Mastering Oculus Rift Development

By : Jack Donovan
Book Image

Mastering Oculus Rift Development

By: Jack Donovan

Overview of this book

Virtual reality (VR) is changing the world of gaming and entertainment as we know it. VR headsets such as the Oculus Rift immerse players in a virtual world by tracking their head movements and simulating depth, giving them the feeling that they are actually present in the environment. We will first use the Oculus SDK in the book and will then move on to the widely popular Unity Engine, showing you how you can add that extra edge to your VR games using the power of Unity. In this book, you’ll learn how to take advantage of this new medium by designing around each of its unique features. This book will demonstrate the Unity 5 game engine, one of most widely-used engines for VR development, and will take you through a comprehensive project that covers everything necessary to create and publish a complete VR experience for the Oculus Rift. You will also be able to identify the common perils and pitfalls of VR development to ensure that your audience has the most comfortable experience possible. By the end of the book, you will be able to create an advanced VR game for the Oculus Rift, and you’ll have everything you need to bring your ideas into a new reality.
Table of Contents (17 chapters)
Mastering Oculus Rift Development
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Using Unity's matchmaker system


Unity's network manager contains several functions used for interacting with a matchmaking system that allows hosts to list their games on the Internet and potential players to find them. This is what will let players join and play games with others without needing to know the host's IP address.

We'll build out a JoinCanvas menu in this section, allowing you to search for games instead of just creating them, but first we need to modify our hosting functions to post data to the matchmaking server.

Creating a matchmaker game

To use the matchmaker, we'll have to explicitly initialize it in code first. Add two using statements to the top of your NetworkGameManager script to include the Match and Types namespaces:

unity UnityEngine;
using System.Collections;
using UnityEngine.Networking;
using UnityEngine.Networking.Match;
using UnityEngine.Networking.Types;
using UnityEngine.UI;

Next, add the following line to Start in the NetworkGameManager...