Exemplo n.º 1
0
 void screenShotImmediate()
 {
     Debug.Log("Screenshotting on dispatch thread");
     try
     {
         var             ss       = TextureScale.CreateScreenshotPNG(Camera.main, request.Width, request.Height);
         ProtoScreenShot response = new ProtoScreenShot()
         {
             Width    = request.Width,
             Height   = request.Height,
             Channels = 3,
             Data     = ByteString.CopyFrom(ss)
         };
         promise.Resolve(new ProtoMessage(response));
     }
     catch (Exception e)
     {
         Debug.Log($"failed screenshot: {e}");
         promise.Reject(e);
     }
 }