示例#1
0
    private void UpdateStreamStartStop()
    {
        // This methods assumes it is called from a safe location to call Astra API
        _isDepthOn         = ToggleDepth == null || ToggleDepth.isOn;
        _isColorOn         = ToggleColor == null || ToggleColor.isOn;
        _isBodyOn          = ToggleBody == null || ToggleBody.isOn;
        _isMaskedColorOn   = ToggleMaskedColor == null || ToggleMaskedColor.isOn;
        _isColorizedBodyOn = ToggleColorizedBody == null || ToggleColorizedBody.isOn;

        if (_isDepthOn)
        {
            _depthStream.Start();
        }
        else
        {
            _depthStream.Stop();
        }

        if (_isColorOn)
        {
            _colorStream.Start();
        }
        else
        {
            _colorStream.Stop();
        }

        if (_isBodyOn)
        {
            _bodyStream.Start();
        }
        else
        {
            _bodyStream.Stop();
        }

        if (_isMaskedColorOn)
        {
            _maskedColorStream.Start();
        }
        else
        {
            _maskedColorStream.Stop();
        }

        if (_isColorizedBodyOn)
        {
            _colorizedBodyStream.Start();
        }
        else
        {
            _colorizedBodyStream.Stop();
        }
    }
示例#2
0
    private void UpdateStreamStartStop()
    {
        if (ToggleDepth == null || ToggleDepth.isOn)
        {
            _depthStream.Start();
        }
        else
        {
            _depthStream.Stop();
        }

        if (ToggleColor == null || ToggleColor.isOn)
        {
            _colorStream.Start();
        }
        else
        {
            _colorStream.Stop();
        }

        if (ToggleBody == null || ToggleBody.isOn)
        {
            _bodyStream.Start();
        }
        else
        {
            _bodyStream.Stop();
        }

        if (ToggleMaskedColor == null || ToggleMaskedColor.isOn)
        {
            _maskedColorStream.Start();
        }
        else
        {
            _maskedColorStream.Stop();
        }

        if (ToggleColorizedBody == null || ToggleColorizedBody.isOn)
        {
            _colorizedBodyStream.Start();
        }
        else
        {
            _colorizedBodyStream.Stop();
        }
    }
示例#3
0
    private void UpdateStreamStartStop()
    {
        // This methods assumes it is called from a safe location to call Astra API
        _isDepthOn         = ToggleDepth == null || ToggleDepth.isOn;
        _isColorOn         = ToggleColor == null || ToggleColor.isOn;
        _isNV21ColorOn     = ToggleNV21Color == null || ToggleNV21Color.isOn;
        _isBodyOn          = ToggleBody == null || ToggleBody.isOn;
        _isMaskedColorOn   = ToggleMaskedColor == null || ToggleMaskedColor.isOn;
        _isColorizedBodyOn = ToggleColorizedBody == null || ToggleColorizedBody.isOn;

        if (_isDepthOn)
        {
            _depthStream.Start();
        }
        else
        {
            _depthStream.Stop();
        }

        if (_isColorOn)
        {
            _colorStream.Start();
        }
        else
        {
            _colorStream.Stop();
        }

#if ASTRA_UNITY_ANDROID_NATIVE
        if (_readerNV21Color != null)
        {
            if (_isNV21ColorOn)
            {
                _nv21ColorStream.Start();
            }
            else
            {
                _nv21ColorStream.Stop();
            }
        }
#endif

        if (_isBodyOn)
        {
            _bodyStream.Start();
        }
        else
        {
            _bodyStream.Stop();
        }

        if (_isMaskedColorOn)
        {
            _maskedColorStream.Start();
        }
        else
        {
            _maskedColorStream.Stop();
        }

        if (_isColorizedBodyOn)
        {
            _colorizedBodyStream.Start();
        }
        else
        {
            _colorizedBodyStream.Stop();
        }
    }
示例#4
0
    private void UpdateStreamStartStop()
    {
        // This methods assumes it is called from a safe location to call Astra API

        if (_depthStream != null)
        {
            if (_isDepthOn)
            {
                _depthStream.Start();
            }
            else
            {
                _depthStream.Stop();
            }
        }

        if (_colorStream != null)
        {
            if (_isColorOn)
            {
                _colorStream.Start();
            }
            else
            {
                _colorStream.Stop();
            }
        }

        if (_bodyStream != null)
        {
            if (_isBodyOn)
            {
                _bodyStream.Start();
            }
            else
            {
                _bodyStream.Stop();
            }
        }

        if (_maskedColorStream != null)
        {
            if (_isMaskedColorOn)
            {
                _maskedColorStream.Start();
            }
            else
            {
                _maskedColorStream.Stop();
            }
        }

        if (_colorizedBodyStream != null)
        {
            if (_isColorizedBodyOn)
            {
                _colorizedBodyStream.Start();
            }
            else
            {
                _colorizedBodyStream.Stop();
            }
        }
    }