Example #1
0
    public void Update()
    {
        IsDataValid                    = false;
        IsDataHighConfidence           = false;
        ShouldUseSystemGestureMaterial = false;

        if (IsInitialized)
        {
            bool shouldRender = false;

            if (_dataProvider != null)
            {
                var data = _dataProvider.GetSkeletonRendererData();

                IsDataValid                    = data.IsDataValid;
                IsDataHighConfidence           = data.IsDataHighConfidence;
                ShouldUseSystemGestureMaterial = data.ShouldUseSystemGestureMaterial;

                shouldRender = data.IsDataValid && data.IsDataHighConfidence;

                if (data.IsDataValid)
                {
                    _scale = data.RootScale;
                }
            }

            for (int i = 0; i < _boneVisualizations.Count; i++)
            {
                _boneVisualizations[i].Update(_scale, shouldRender, ShouldUseSystemGestureMaterial, _confidenceBehavior, _systemGestureBehavior);
            }

            for (int i = 0; i < _capsuleVisualizations.Count; i++)
            {
                _capsuleVisualizations[i].Update(_scale, shouldRender, ShouldUseSystemGestureMaterial, _confidenceBehavior, _systemGestureBehavior);
            }
        }
#if UNITY_EDITOR
        else
        {
            if (OVRInput.IsControllerConnected(OVRInput.Controller.Hands) && !IsInitialized)
            {
                Initialize();
            }
        }
#endif
    }
    public void Update()
    {
        if (_isInitialized)
        {
            bool shouldRender = false;

            if (_dataProvider != null)
            {
                var data = _dataProvider.GetSkeletonRendererData();

                shouldRender = data.IsDataValid && data.IsDataHighConfidence;

                if (data.IsDataValid)
                {
                    _scale = data.RootScale;
                }
            }

            for (int i = 0; i < _boneVisualizations.Count; i++)
            {
                _boneVisualizations[i].Update(_scale, shouldRender);
            }
        }
    }