A legacy Unity asset (2017, built with Unity 5.2.0f3) for taking in-game snapshots at runtime. The captured area is specified with a RectTransform, so you can crop exactly the region covered by a UI element — no extra code required for basic use.
- Region capture via
RectTransform— the snapshot is cropped to the world rect of a target UI element - Two capture backends with automatic selection (
Recommendedmode):RenderTexture— used in the Editor and on desktop platformsApplication.CaptureScreenshot— used on iOS/Android, where the RenderTexture path was unreliable at the time
- UI hiding options during screenshot capture (
DontHide/InvisibleCanvas/InvisibleTargetRectUI) - Inspector integration — custom editors with contextual tips and warnings, plus a no-code
CaptureSnapshotHelperthat exposes aUnityEvent<Texture>callback - Scene gizmo marking the capture area
- Sample scene and a usage PDF included
- Unity 5.2 era (created with 5.2.0f3). Modern Unity versions will require migration:
Application.CaptureScreenshotwas replaced byScreenCapture.CaptureScreenshotin Unity 2017.1+.
- Open
Assets/ZYXW RectSnap/Scenes/Sample.unityand run it to see the asset in action. - Add
CaptureSnapshotto a GameObject, assign theTarget Area(RectTransform) andSource Camera. - Either call
TakeSnapshot(Action<Texture>)from code, or addCaptureSnapshotHelper, wire itsUnityEvent<Texture>callback in the Inspector, and callSnap().
GetComponent<CaptureSnapshot>().TakeSnapshot(texture => {
// use the cropped Texture
});Assets/ZYXW RectSnap/
├── Scripts/ # CaptureSnapshot, CaptureSnapshotHelper
├── Editor/ # Custom inspectors with tips
├── Scenes/ # Sample scene
├── Textures/ # Sample frame texture
└── Documentation/ # ReadMe.txt, Usage.pdf
This is a legacy asset-store-style package from 2017 and is not actively maintained. The APIs it relies on have changed in modern Unity; treat it as a reference implementation.
