Skip to content

TBEditorBuildSettings

Holden Link edited this page Jan 20, 2017 · 12 revisions

Overview

An editor window for switching between different platform SDKs. Generates scripting defines that are used across TButt.

Dependencies

None.

Usage

Initial Setup

Import the plugins for each platform that you wish to support. TButt currently supports the following platforms:

Platform    | SDK / Plugin
------------| ------------
Oculus Rift | [Oculus Utilities for Unity](https://developer3.oculus.com/downloads/)
Steam VR    | [Steam VR Plugin](https://www.assetstore.unity3d.com/en/#!/content/32647)
PSVR        | Must have Unity PS4 module installed
Gear VR     | [Oculus Utilities for Unity](https://developer3.oculus.com/downloads/)
Cardboard   | [Google VR SDK for Unity](https://github.com/googlevr/gvr-unity-sdk/)
Daydream    |  [Google VR SDK for Unity](https://github.com/googlevr/gvr-unity-sdk/)

You'll see a "Turbo Button" dropdown on your menu bar after importing TButt to your project. Go to "Turbo Button -> Build Settings..." to set your target SDK.

Reference

TBEditorBuildSettings window

Platform Settings

Choose the platform you'd like to target from the dropdown.

Note: This does not replace changing platforms in Unity, or Unity's Build Settings / Player Settings. This only changes platform SDKs. For example, it's possible to run in Daydream mode even when the editor is set to PC. But if you wanted to make a build for Daydream, you'd also have to switch to Android in Unity's build settings.

Swapping Manifests (Android Platforms Only)

If "Swap Manifests" is checked, your AndroidManfiest.xml will be swapped out for the platform you've specified. The manifests are stored in the Assets/TButt/Manifests folder. This can be useful for switching between different manifests for Daydream, Gear VR, and Cardboard.

Daydream Emulation (Daydream Only)

TButt can emulate Daydream with Vive or Oculus Rift. This functionality is optional.

Emulation Mode Scripting Define
Native Only looks for input from a Daydream controller, and uses Daydream camera. Use for builds.
Rift Uses Oculus Touch if a Daydream controller is not connected, and uses Oculus camera.
Steam VR Uses Vive controller if a Daydream controller is not connected, and uses Steam VR camera.

Build Flavors

These are optional checkboxes that toggle other scripting defines to your project. Nothing in TButt uses these by default, they're just there for convenience if you decide to use them for your own stuff. For example, we use the Demo tag to make the build have a different behavior when prepping demos for conferences.

Flavor Scripting Define
Debug DEBUGMODE
Demo DEMOMODE
Release RELEASE

Scripting Defines

If your project has scripting defines in Unity's PlayerSettings, add them to the Custom Defines box.

If you want to add your own platform-specific code, you can take advantage of the scripting defines created for each platform in the Build Settings menu.

Platform Scripting Define
Oculus Rift RIFT
Steam VR (Vive) STEAM_VR
PlayStation VR MORPHEUS
Gear VR GEAR_VR
Daydream DAYDREAM
Cardboard CARDBOARD

If you are using Daydream with Rift or Vive emulation, then your definitions are FAKE DAYDREAM and either RIFT or STEAM_VR.

Example:

#if RIFT
Debug.Log("This will only execute on Rift.");
#elif DAYDREAM || GEAR_VR
Debug.Log("This will only execute on Daydream and Gear VR.");
#elif FAKE_DAYDREAM && STEAM_VR
Debug.Log("This will only execute when emulating Daydream with Steam VR.
#endif