Last active
June 12, 2017 06:14
-
-
Save dariol/e99d465989ec435cd850428bd9bf9867 to your computer and use it in GitHub Desktop.
SteamVR_Render.cs workaround to allow arbitrary 3rd controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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