Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Prefab Preview Screenshot

A Unity Editor tool that adds a Screenshot tab to the Inspector preview for objects placed in a scene. Use it to frame an object and save a transparent PNG without setting up a separate screenshot camera.

I made this while developing Camp Paradise: Island Resort Tycoon.

Installation

  1. Make sure your project uses the Universal Render Pipeline (URP) - Untested with standard.
  2. Copy PrefabPreviewScreenshot.cs into an Editor folder in your Unity project—for example, Assets/Editor/PrefabPreviewScreenshot.cs.
  3. Let Unity finish compiling.

The Editor folder is required because the script uses Unity Editor APIs and must not be included in a game build.

How to use

  1. Select a GameObject placed in a scene that has a visible Renderer.
  2. Open its Inspector preview and select the Screenshot tab if not already selected.
  3. Adjust the view, choose a resolution, and click Save PNG.

Controls

  • Left-drag: Rotate the object view
  • Right-drag: Adjust the preview lighting
  • Middle-drag: Pan
  • Scroll wheel: Zoom

The toolbar also has zoom, silhouette, bloom and resolution options. If the object has animation clips, you can choose a clip and scrub to a pose.

Images are saved to Assets/Icons/PrefabIcons/ as transparent PNGs and imported as Sprites. Saving another image of an object with the same name will overwrite its previous screenshot.

Current limitations

  • The object must be placed in a scene. Selecting a prefab directly in the Project window is not supported.
  • The preview uses lighting from the open scene.
  • This version is built for URP; other render pipelines have not been tested.
  • Terrain objects are not supported.

About

Converts the Unity prefab inspector preview into an icon tool.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages