Ejemplo n.º 1
0
    protected CaptureTool.CaptureResult Capture()
    {
        Camera _camera = this.camera == null ? Camera.main : this.camera;

        int[] gameViewResolution = GetGameViewResolution();
        int   _imageWidth        = (int)((this.imageWidth == 0 ? gameViewResolution[0] : this.imageWidth) * this.imageScale);
        int   _imageHeight       = (int)((this.imageHeight == 0 ? gameViewResolution[1] : this.imageHeight) * this.imageScale);

        CaptureTool.CaptureResult result
            = CaptureTool.Capture(_camera,
                                  textureFormat,
                                  outputFileExtension,
                                  _imageWidth,
                                  _imageHeight,
                                  this.clearBack,
                                  this.outputDirectory,
                                  this.outputFileName
                                  + this.outputFileNameIndex.ToString());

        if (result.success)
        {
            this.ShowNotification(new GUIContent("SUCCESS : " + result.outputPath));
            this.outputFileNameIndex++;
        }
        else
        {
            if (camera == null)
            {
                this.ShowNotification(new GUIContent("ERROR : " + "Camera in null (also MainCamera is null)"));
            }
            else
            {
                this.ShowNotification(new GUIContent("ERROR : " + result.outputPath));
            }
        }

        return(result);
    }
Ejemplo n.º 2
0
 protected virtual void HookAfterImageCaptured(CaptureTool.CaptureResult result)
 {
     // Nothing to do in here. This is used for inheritance.
 }