コード例 #1
0
ファイル: TxKitEyes.cs プロジェクト: red-pencil/ISWC18
    void OnRobotDisconnected()
    {
        if (_cameraSource != null)
        {
            _cameraSource.Close();
            _cameraSource = null;
        }

        if (_imageProcessor != null)
        {
            _imageProcessor.Destroy();
            _imageProcessor = null;
        }

        for (int i = 0; i < Output.TexturesCount; ++i)
        {
            Output.SetTexture(TxEyesOutput.NullTexture, i);
        }

        _cameraProfile = "";
        _camsInited    = false;
    }
コード例 #2
0
    void OnRobotDisconnected()
    {
        if (_camRenderer [0] != null)
        {
            _camRenderer [0].Disable();
        }
        if (_camRenderer [1] != null)
        {
            _camRenderer [1].Disable();
        }


        if (_cameraSource != null)
        {
            _cameraSource.Close();
            _cameraSource = null;
        }

        for (int i = 0; i < _camRenderer.Length; ++i)
        {
            if (_camRenderer [i])
            {
                _camRenderer [i].RequestDestroy();
            }
        }
        for (int i = 0; i < _camRendererParents.Length; ++i)
        {
            if (_camRendererParents [i] != null)
            {
                GameObject.Destroy(_camRendererParents [i]);
                _camRendererParents [i] = null;
            }
        }
        _cameraProfile = "";
        _camsInited    = false;
    }