Ejemplo n.º 1
0
    private IEnumerator SaveMainScreenshot(string _dateStr)
    {
        var raw = ScreenCapture.CaptureScreenshotAsTexture();

        var rect = GetScreenshotCropRect();

        int ix = ( int )rect.x;
        int iy = ( int )rect.y;
        int iw = ( int )rect.width;

        int ih = ( int )rect.height;

        Color[] c = raw.GetPixels(ix, iy, iw, ih);

        var tex = new Texture2D(iw, ih);

        tex.SetPixels(c);
        tex.Apply(false);



        string fileName = _dateStr + ".png";

        yield return(StartCoroutine(TGTextureHelper.SaveTexture(tex, fileName)));
    }
Ejemplo n.º 2
0
    private IEnumerator SaveHeatmapTex(string _dateStr)
    {
        if (controller.heatmapInput.enabled)
        {
            string fileName = "heat_" + _dateStr + ".png";

            //FIXME: 要把它调整到UI底下

            controller.heatmapInput.ApplyHeatmap();
            yield return(StartCoroutine(TGTextureHelper.SaveTexture(controller.heatmapInput.outputTex, fileName)));
        }

        yield return(null);
    }