https://github.com/alaxxxx/codepreview
Improves Unity code preview in the inspector
https://github.com/alaxxxx/codepreview
csharp unity unityeditor
Last synced: 9 months ago
JSON representation
Improves Unity code preview in the inspector
- Host: GitHub
- URL: https://github.com/alaxxxx/codepreview
- Owner: Alaxxxx
- License: mit
- Created: 2025-08-30T18:49:55.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-08-30T19:26:04.000Z (9 months ago)
- Last Synced: 2025-08-30T20:37:04.464Z (9 months ago)
- Topics: csharp, unity, unityeditor
- Language: C#
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CodePreview for Unity
### 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)
## ✨ 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 Git URL (Recommended)
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**](https://github.com/Alaxxxx/CodePreview/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](https://github.com/Alaxxxx/CodePreview/issues) 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!