Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Assets/WebVR/Scripts/WebVRManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public enum WebVRState { ENABLED, NORMAL }

public class WebVRManager : MonoBehaviour
{
private static string GlobalName = "WebVRCameraSet";

[Tooltip("Name of the key used to alternate between VR and normal mode. Leave blank to disable.")]
public string toggleVRKeyName;

Expand Down Expand Up @@ -57,7 +59,7 @@ public static WebVRManager Instance {
if (instance == null)
{
var managerInScene = FindObjectOfType<WebVRManager>();
var name = "WebVRManager";
var name = GlobalName;

if (managerInScene != null)
{
Expand All @@ -78,6 +80,11 @@ private void Awake()
{
Debug.Log("Active Graphics Tier: " + Graphics.activeTier);
instance = this;

if(!GlobalName.Equals(instance.name)) {
Debug.LogError("The webvr.js script requires the WebVRManager gameobject to be named "
+ GlobalName + " for proper functioning");
}

if (instance.dontDestroyOnLoad)
{
Expand Down