Merge pull request #46 from tverona1/oculus_integration_fix
Oculus integration timing fix to show hands
This commit is contained in:
@@ -66,7 +66,10 @@ public class OVRMesh : MonoBehaviour
|
||||
|
||||
private void Initialize(MeshType meshType)
|
||||
{
|
||||
_mesh = new Mesh();
|
||||
if (null == _mesh)
|
||||
{
|
||||
_mesh = new Mesh();
|
||||
}
|
||||
|
||||
var ovrpMesh = new OVRPlugin.Mesh();
|
||||
if (OVRPlugin.GetMesh((OVRPlugin.MeshType)_meshType, out ovrpMesh))
|
||||
@@ -120,10 +123,9 @@ public class OVRMesh : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void Update()
|
||||
{
|
||||
if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands) && !IsInitialized)
|
||||
if (!IsInitialized && OVRInput.IsControllerConnected(OVRInput.Controller.Hands))
|
||||
{
|
||||
if (_meshType != MeshType.None)
|
||||
{
|
||||
@@ -131,5 +133,4 @@ public class OVRMesh : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -171,14 +171,9 @@ public class OVRMeshRenderer : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
else
|
||||
else if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands))
|
||||
{
|
||||
if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands))
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
Initialize();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,15 +292,13 @@ public class OVRSkeleton : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands) && !IsInitialized)
|
||||
if (!IsInitialized && OVRInput.IsControllerConnected(OVRInput.Controller.Hands))
|
||||
{
|
||||
if (_skeletonType != SkeletonType.None)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!IsInitialized || _dataProvider == null)
|
||||
{
|
||||
|
||||
@@ -236,11 +236,26 @@ public class OVRSkeletonRenderer : MonoBehaviour
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
_boneVisualizations = new List<BoneVisualization>();
|
||||
_capsuleVisualizations = new List<CapsuleVisualization>();
|
||||
_ovrSkeleton = GetComponent<OVRSkeleton>();
|
||||
_skeletonGO = new GameObject("SkeletonRenderer");
|
||||
_skeletonGO.transform.SetParent(transform, false);
|
||||
if (null == _boneVisualizations)
|
||||
{
|
||||
_boneVisualizations = new List<BoneVisualization>();
|
||||
}
|
||||
|
||||
if (null == _capsuleVisualizations)
|
||||
{
|
||||
_capsuleVisualizations = new List<CapsuleVisualization>();
|
||||
}
|
||||
|
||||
if (null == _ovrSkeleton)
|
||||
{
|
||||
_ovrSkeleton = GetComponent<OVRSkeleton>();
|
||||
}
|
||||
|
||||
if (null == _skeletonGO)
|
||||
{
|
||||
_skeletonGO = new GameObject("SkeletonRenderer");
|
||||
_skeletonGO.transform.SetParent(transform, false);
|
||||
}
|
||||
|
||||
if (_skeletonMaterial == null)
|
||||
{
|
||||
@@ -331,15 +346,10 @@ public class OVRSkeletonRenderer : MonoBehaviour
|
||||
_capsuleVisualizations[i].Update(_scale, shouldRender, ShouldUseSystemGestureMaterial, _confidenceBehavior, _systemGestureBehavior);
|
||||
}
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
else
|
||||
else if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands))
|
||||
{
|
||||
if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands) && !IsInitialized)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
Initialize();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
|
||||
@@ -8303,7 +8303,7 @@ PrefabInstance:
|
||||
- target: {fileID: 114392993255165844, guid: 835e735ca71bf78459fb2cababd74112,
|
||||
type: 3}
|
||||
propertyPath: m_Enabled
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 114392993255165844, guid: 835e735ca71bf78459fb2cababd74112,
|
||||
type: 3}
|
||||
@@ -9912,7 +9912,7 @@ PrefabInstance:
|
||||
- target: {fileID: 114392993255165844, guid: 835e735ca71bf78459fb2cababd74112,
|
||||
type: 3}
|
||||
propertyPath: m_Enabled
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 114392993255165844, guid: 835e735ca71bf78459fb2cababd74112,
|
||||
type: 3}
|
||||
|
||||
Reference in New Issue
Block a user