Skip to content

Commit 7c4142e

Browse files
author
lawwong
committed
Fix SteavVRCameraHook not expend head-eye-ear correctly
1 parent db23db4 commit 7c4142e

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

Assets/HTC.UnityPlugin/ViveInputUtility/Prefabs/ViveCameraRig.prefab

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ GameObject:
2626
- 4: {fileID: 404836}
2727
- 20: {fileID: 2071970}
2828
- 124: {fileID: 12406598}
29+
- 81: {fileID: 8189340}
30+
- 92: {fileID: 9261234}
2931
- 114: {fileID: 11413550}
3032
m_Layer: 0
3133
m_Name: Camera
@@ -399,6 +401,20 @@ Camera:
399401
m_StereoConvergence: 10
400402
m_StereoSeparation: 0.022
401403
m_StereoMirrorMode: 0
404+
--- !u!81 &8189340
405+
AudioListener:
406+
m_ObjectHideFlags: 1
407+
m_PrefabParentObject: {fileID: 0}
408+
m_PrefabInternal: {fileID: 100100000}
409+
m_GameObject: {fileID: 116882}
410+
m_Enabled: 1
411+
--- !u!92 &9261234
412+
Behaviour:
413+
m_ObjectHideFlags: 1
414+
m_PrefabParentObject: {fileID: 0}
415+
m_PrefabInternal: {fileID: 100100000}
416+
m_GameObject: {fileID: 116882}
417+
m_Enabled: 1
402418
--- !u!114 &11401118
403419
MonoBehaviour:
404420
m_ObjectHideFlags: 1

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRCameraHook.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@ private void OnModuleActivated(VRModuleActiveEnum activatedModule)
2222
{
2323
if (activatedModule == VRModuleActiveEnum.SteamVR)
2424
{
25-
var earsComp = default(SteamVR_Ears);
26-
for (int i = transform.childCount - 1; i >= 0; --i)
27-
{
28-
earsComp = transform.GetChild(i).GetComponentInChildren<SteamVR_Ears>();
29-
if (earsComp != null) { break; }
30-
}
31-
32-
if (earsComp == null)
33-
{
34-
var ears = new GameObject("Camera (ears)", typeof(AudioListener), typeof(SteamVR_Ears));
35-
ears.transform.SetParent(transform, false);
36-
}
37-
3825
if (GetComponent<SteamVR_Camera>() == null)
3926
{
4027
gameObject.AddComponent<SteamVR_Camera>();

0 commit comments

Comments
 (0)