Beispiel #1
0
    void Start()
    {
        _DataManager = GetComponent <ServerDataManager>();
        if (_DataManager == null)
        {
            return;
        }

        if (_DataManager.GetDownsampleSize() == 1)
        {
            return;
        }

        width  = _DataManager.DSPWidth;
        height = _DataManager.DSPHeight;

        // create a fixed size mesh
        // mesh vertex position/color will be updated every frame
        _Mesh = new Mesh();
        GetComponent <MeshFilter>().mesh = _Mesh;
        CreateMesh(width, height);
    }
Beispiel #2
0
    void Update()
    {
        _DataManager = DataManager.GetComponent <ServerDataManager>();
        if (_DataManager == null)
        {
            return;
        }

        if (_DataManager.GetDownsampleSize() == 1)
        {
            return;
        }

        if (_Mesh == null)
        {
            width  = _DataManager.DSPWidth;
            height = _DataManager.DSPHeight;
            _Mesh  = new Mesh();
            GetComponent <MeshFilter>().mesh = _Mesh;
            CreateMesh(width, height);
        }

        _DepthData = _DataManager.GetSavedDepthData();
        if (_DepthData == null)
        {
            return;
        }

        _ColorData = _DataManager.GetSavedColorData();
        if (_ColorData == null)
        {
            return;
        }

        RefreshMesh(width, height);
    }