/// <summary> /// Run DeePoon HMD /// </summary> public static void create() { if (_instance != null) { _instance.gameObject.SetActive(true); return; } #if UNITY_ANDROID && !UNITY_EDITOR _java_activity.Init(); #endif Composer.Init(); //create a new DeviceObject GameObject device_object = new GameObject (Common.DeePoonDeviceGameObjectName , typeof(DpnDevice)); if (DpnManager.DPVRPointer) { GameObject eventSystem = new GameObject("EventSystem", typeof(EventSystem)); eventSystem.AddComponent <DpnPointerInputModule>(); eventSystem.transform.SetParent(device_object.transform); } //Don't destroy it. DontDestroyOnLoad(device_object); //get device _instance = device_object.GetComponent <DpnDevice>(); }
/// <summary> /// Run DeePoon HMD /// </summary> public static void create() { if (_instance != null) { _instance.gameObject.SetActive(true); return; } #if UNITY_ANDROID && !UNITY_EDITOR _java_activity.Init(); #endif Composer.Init(); //create a new DeviceObject GameObject device_object = new GameObject (Common.DeePoonDeviceGameObjectName , typeof(DpnDevice)); if (DpnManager.DPVRPointer) { EventSystem eventSystem = FindObjectOfType <EventSystem>(); if (eventSystem == null) { Debug.LogWarning("DpnEventSystem is needed after version 0.7.5."); GameObject gameObject = new GameObject("DpnEventSystem", typeof(EventSystem)); eventSystem = gameObject.GetComponent <EventSystem>(); } { DpnStandaloneInputModule inputModule = eventSystem.GetComponent <DpnStandaloneInputModule>(); if (inputModule == null) { Debug.LogWarning("DpnStandaloneInputModule component must be in the EventSystem, after version 0.7.5."); eventSystem.gameObject.AddComponent <DpnStandaloneInputModule>(); } } } //Don't destroy it. DontDestroyOnLoad(device_object); //get device _instance = device_object.GetComponent <DpnDevice>(); }