Skip to content

Instantly share code, notes, and snippets.

@dariol
Last active June 12, 2017 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dariol/e99d465989ec435cd850428bd9bf9867 to your computer and use it in GitHub Desktop.
Save dariol/e99d465989ec435cd850428bd9bf9867 to your computer and use it in GitHub Desktop.
SteamVR_Render.cs workaround to allow arbitrary 3rd controller
void Awake()
{
#if (UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
var go = new GameObject("cameraMask");
go.transform.parent = transform;
cameraMask = go.AddComponent<SteamVR_CameraMask>();
#endif
if (System.IO.File.Exists(externalCameraConfigPath)) {
{
if (externalCamera == null) {
var prefab = Resources.Load<GameObject>("SteamVR_ExternalCamera");
var instance = Instantiate(prefab);
instance.gameObject.name = "External Camera";
}
externalCamera = instance.transform.GetChild(0).GetComponent<SteamVR_ExternalCamera>();
externalCamera.configPath = externalCameraConfigPath;
externalCamera.ReadConfig();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment