Unity Inverse mask showing only the the parts in the middle.

preview_player
Показать описание
Inverse UI Mask hides anything inside the masked UI area and shows everything outside. Think of it as a negative mask or inverted mask.

✔ Code & Code-Less options
You don't like foreign code in your project? No problem! Check out the NoCodeDemo in the examples.

✔ Non-destructive
Unlike other masking solutions this one leaves your materials alone. Not extra shaders, not changes to your assets!

✔ URP / HDRP / BuiltIn Support
Works with all render pipelines.

✔ Sprite Mesh shapes
Use any of your images or one of the predefined resolution-independent sprite meshes.

✔ Content and masks can be moved independently
No parent/child dependency in the hierarchy.

✔ Punch as many holes as you like
Automatically merges mask objects into one mask.

✔ Full Source Code
Comments in the code explain everything. Uses assembly definitions to improve compile times.

I publish this template with full source code because as a developer I know how annoying it is to not have source code access. If you like it then please remind others to purchase the plugin. Don't just copy and paste it everywhere. Thank you ❤️

✔ Demo included
Under InvertedMask/Examples you will find two scenes with examples. You can copy the mask from there.

✔ Supports Unity 2020, 2021, 2022+ LTS
Sadly the Asset Store no longer allows uploads of 2019 projects. Please contact support if you need the 2019 version. It works in 2019 too!

⚙️ Installation
Download the Asset and import it into your project.
You are done, no additional setup is needed.

✍️ Usage
Step 1: Create a new empty GameObject.
Step 2: Add the "InvertedMask" Component.
Step 3: Click the "Add Hole" and "Add Content" button.
Step 4: You are done.
Рекомендации по теме