Improves Unity code preview in the inspector
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Alaxxxx b681a330d3 Improvements
Search highlighting matching text inside generated color tags, causing false positives on common letters

Replaced default font with Unity's built-in monospace font (RobotoMono) for better code readability
Redesigned inspector layout: minimal header always visible, all options and stats moved into a single collapsed foldout
Reduced overall padding and spacing to give more room to the code preview
2026-05-17 09:56:35 +02:00
Editor Improvements 2026-05-17 09:56:35 +02:00
.gitattributes Initial commit 2025-08-30 20:49:46 +02:00
.gitignore Initial commit 2025-08-30 20:49:46 +02:00
Editor.meta Initial commit 2025-08-30 20:49:46 +02:00
LICENSE.md Fix License 2025-09-02 20:12:39 +02:00
LICENSE.md.meta Fix License 2025-09-02 20:12:39 +02:00
OpalStudio.CodePreview.asmdef Encapsulate 2025-10-14 17:52:05 +02:00
OpalStudio.CodePreview.asmdef.meta Encapsulate 2025-10-14 17:52:05 +02:00
package.json Improvements 2026-05-17 09:56:35 +02:00
package.json.meta Add package manifest 2025-08-30 21:24:30 +02:00
README.md Add Unity asset store link 2026-03-21 19:07:05 +01:00
README.md.meta Fix namespace 2025-08-30 20:51:44 +02:00

CodePreview for Unity

GitHub Stars   GitHub Followers   Last Commit

Release   Unity Version   License

CodePreview Screenshot

A powerful and customizable preview for the Unity inspector.

Tired of Unity's tiny, unhelpful default inspector for scripts? CodePreview transforms it into a genuine productivity tool. Quickly understand, navigate, and manage your text-based assets without ever leaving the editor.

✨ Key Functionality

  • Theme-Aware Syntax Highlighting: Read C#, JSON, XML and more with beautiful highlighting that automatically adapts to Unity's Light and Dark themes.
  • Pleasant Markdown Reading: Instead of a plain text file, your .md files are presented with syntax coloring for headers, lists, and code blocks, making them far easier to read.
  • Instant Navigation: Instantly search through any file with highlighted results and jump directly to any line number.
  • File Statistics: Get instant insights at a glance: line and word counts, file size, and the last modification date.
  • Quick Actions Toolbar: Edit in your IDE, copy the file path, or copy the entire content to your clipboard with a single click.

🎯 Supported Formats

  • C# (.cs)
  • JSON (.json)
  • XML (.xml)
  • YAML (.yaml)
  • Markdown (.md)

🚀 Get Started »


✨ Features

  • 🎨 Advanced Syntax Highlighting: A clean and readable preview for all supported languages, compatible with Unity's Light and Dark themes.
  • 📄 Rendered Markdown Preview: View your .md (README) files rendered directly in the inspector for a much more pleasant reading experience.
  • 🔍 Powerful Navigation: Instantly find what you need with a built-in search tool that highlights all matches. Jump to any line number with the Go to Line feature.
  • 📊 Detailed Insights: Get a complete overview of your file: line, word, and character counts, file size, and last modification date.
  • 🧠 Smart Header: Automatically detects and displays the script type (MonoBehaviour, ScriptableObject, etc.) for immediate context.
  • ⚙️ Highly Customizable: Adjust the font size, preview height, and other display options in a polished foldout menu.
  • ⚡ Quick Actions: A handy toolbar to edit the script in your IDE, ping the file, copy its path, or copy its entire content.

🚀 Installation

Choose your preferred installation method below. The recommended method is via Git URL.

1. Install via Unity Asset Store (Recommended)
This is the easiest way to install and receive updates.
  1. Open the CodePreview page on the Unity Asset Store and click "Add to My Assets".
  2. In your Unity project, open the Package Manager (Window > Package Manager).
  3. In the Package Manager window, select the "Packages: My Assets" view from the top-left dropdown menu.
  4. Find CodePreview in the list and click the "Import" button.
2. Install via Git URL

This method installs the package directly from GitHub and allows you to update it easily.

  1. In Unity, open the Package Manager (Window > Package Manager).
  2. Click the + button and select "Add package from git URL...".
  3. Enter the following URL and click "Add":
    https://github.com/Alaxxxx/CodePreview.git
    
2. Install via .unitypackage

Ideal if you prefer a specific, stable version of the asset.

  1. Go to the Releases page.
  2. Download the .unitypackage file from the latest release.
  3. In your Unity project, go to Assets > Import Package > Custom Package... and select the downloaded file.
3. Manual Installation (from .zip)
  1. Download this repository as a ZIP file by clicking Code > Download ZIP.
  2. Unzip the file.
  3. Drag the unzipped package folder into your project's Assets directory.

🤝 Contributing & Supporting

This project is open-source under the MIT License, and any form of contribution is welcome and greatly appreciated!

If you find CodePreview useful in your workflow, the easiest way to show your support is by giving it a star ⭐️ on GitHub! It helps a lot with the project's visibility and motivates me to keep improving it.

Here are other ways you can get involved:

  • 💡 Share Ideas & Report Bugs: Have a great idea for a new feature, a supported language, or found a bug? Open an issue to share the details.
  • 🔌 Contribute Code: Feel free to fork the repository and submit a pull request for bug fixes or new features.
  • 🗣️ Spread the Word: Know other Unity developers? Share this tool with them!

Every contribution, from a simple star to a pull request, is incredibly valuable. Thank you for your support!