示例#1
0
    private void Start()
    {
        _camera = this.GetComponent <Camera>();

        if (_camera == null)
        {
            Debug.LogError("_camera is not setting");
            return;
        }


        if (_lensMaterial == null)
        {
            Debug.LogError("lens material is not setting");
            return;
        }

        if (_rotTarget == null)
        {
            Debug.LogError("_rotOffset is not setting");
            return;
        }

        _lastClientUVScale = _clientUVScale;

        _cameraRectDefault = _camera.rect;

        // エンコーダセットアップ
        _encoder.OnEncoded += this.WriteStream;           // 書き込みコールバック

        _eyeInput.Setup(_rotTarget);
        _lensCorrenction.Setup(_camera, _lensMaterial);

#if READ_PIX_DEBUG
        _encoder.Setup(Screen.width, Screen.height, 600, 10);
#endif

        // クライアントから設定が届いた時
        NetworkSender.Instance.NetIO.GetResever <HvNetIOClientSetting>().OnSetting += NetworkSender_OnSetting;
        NetworkSender.Instance.NetIO.GetResever <HvNetIOClientInfo>().OnClientInfo += VRVController_OnClientInfo;
        NetworkSender.Instance.NetIO.OnDisconnected += NetIO_OnDisconnected;

        NetworkSender.Instance.Begin(_port);
    }