https://github.com/haoming02/unity-transparent-window
Simple script to create see-through and click-through window
https://github.com/haoming02/unity-transparent-window
unity win32
Last synced: about 2 months ago
JSON representation
Simple script to create see-through and click-through window
- Host: GitHub
- URL: https://github.com/haoming02/unity-transparent-window
- Owner: Haoming02
- License: mit
- Created: 2024-06-19T09:42:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-02T03:30:42.000Z (over 1 year ago)
- Last Synced: 2025-04-02T04:26:04.543Z (over 1 year ago)
- Topics: unity, win32
- Language: C#
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unity Transparent Window
A simple utility script that lets you build applications with a transparent background, allowing users to see through and click through the window.
> [!Note]
> While this script was primarily written for UnityEngine, it should also work for regular C# programs, as no Unity library was used.
> [!Important]
> Since the script uses functions from `user32.dll`, it is only usable on **Windows** systems
## Features
> This script comes with **3** modes to choose from:
- **Chroma**
- Designate a color *(**eg.** green)* to be cut out
- Areas originally to be rendered with that color, either from UI or objects, will become see-through and click-through
- For 3D scenes, remember to take lighting into account
- Does **not** support half-transparency *(**eg.** feathered edges of a sprite)*
- **Manual**
- Turn the entire screen transparent based on alpha *(**eg.** set the `A` channel of the Camera's **Background** to `0`)*
- Manually control when the program is click-through via code
- Support half-transparency
- **None**
- If you just want to hide the Taskbar icon
### Extras
> Some additional features
- **Always on Top**
- Make the program continue to stay on the screen after the user clicks on other windows underneath *(**ie.** overlay effect)*
- For UnityEngine, enable the **Run in Background** player setting to let the program continue running
- **Hide Taskbar**
- Hide the icon of the program in the Taskbar
- You will need to kill the process via Task Manager, if you did not set up a close button and lost focus to the program
## Prerequisite for Unity
> These requirements only concern UnityEngine
- Disable the **Flip Model Swapchain** under Resolution and Presentation in the Player settings
- Only the **built-in** *(a.k.a **legacy**, **standard**, etc.)* render pipeline is supported
> [!Important]
> To prevent breaking the Editor, this script only functions when actually built
- **Reference:** [Video by. CodeMonkey](https://youtu.be/RqgsGaMPZTw?feature=shared)