further tweak to oculus integration fix
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))
|
||||
@@ -122,7 +125,7 @@ public class OVRMesh : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands) && !IsInitialized)
|
||||
if (!IsInitialized && OVRInput.IsControllerConnected(OVRInput.Controller.Hands))
|
||||
{
|
||||
if (_meshType != MeshType.None)
|
||||
{
|
||||
|
||||
@@ -171,12 +171,9 @@ public class OVRMeshRenderer : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands))
|
||||
{
|
||||
if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands))
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
Initialize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ public class OVRSkeleton : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands) && !IsInitialized)
|
||||
if (!IsInitialized && OVRInput.IsControllerConnected(OVRInput.Controller.Hands))
|
||||
{
|
||||
if (_skeletonType != SkeletonType.None)
|
||||
{
|
||||
|
||||
@@ -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,12 +346,9 @@ public class OVRSkeletonRenderer : MonoBehaviour
|
||||
_capsuleVisualizations[i].Update(_scale, shouldRender, ShouldUseSystemGestureMaterial, _confidenceBehavior, _systemGestureBehavior);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands))
|
||||
{
|
||||
if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands) && !IsInitialized)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user