Exemplo n.º 1
0
    public void Destroy()
    {
        appendBuffer.Release();
        argBuffer.Release();

        AsyncTextureReader.ReleaseTempResources(appendBuffer);
        AsyncTextureReader.ReleaseTempResources(argBuffer);
    }
    public void Destroy()
    {
        appendBuffer.Release();
        argBuffer.Release();

#if !UNITY_ASYNC
        if (needToFree)
        {
            AsyncTextureReader.ReleaseTempResources(appendBuffer);
            AsyncTextureReader.ReleaseTempResources(argBuffer);
        }
#endif
    }
Exemplo n.º 3
0
    private void GetPixels()
    {
        if (Pixels == null)
        {
            return;
        }

        AsyncTextureReader.Status status = AsyncTextureReader.RetrieveTextureData(DebugTexture, Pixels);
        Debug.LogFormat("Frame: {0}; Retrieve Status: {1}", Time.frameCount, status);
        if (status == AsyncTextureReader.Status.Succeeded)
        {
            // print RGBA of first pixel
            Debug.LogFormat("Pixel RGBA: {0}; {1}; {2}; {3}", Pixels[0], Pixels[1], Pixels[2], Pixels[3]);
            Pixels = null;
            AsyncTextureReader.ReleaseTempResources(DebugTexture);
        }
    }
Exemplo n.º 4
0
    private void GetData()
    {
#if UNITY_5_5_OR_NEWER
        if (_floats == null)
        {
            return;
        }

        AsyncTextureReader.Status status = AsyncTextureReader.RetrieveBufferData(_buffer, _floats);
        //Debug.LogFormat("Frame: {0}; Retrieve Buffer Status: {1}", Time.frameCount, status);
        if (status == AsyncTextureReader.Status.Succeeded)
        {
            Debug.LogFormat("Buffer Data: {0}; {1}; {2}; {3}", _floats[0], _floats[1], _floats[2], _floats[3]);
            _floats = null;
            AsyncTextureReader.ReleaseTempResources(_buffer);
        }
#endif
    }