Reverse mask for uGUI element in Unity.
<< Description | WebGL Demo | Installation | Usage | Contributing >>
Unmask provides the following features:
- Reverse mask
- Ray through the unmasked rectangle
- Following another object
- Support nesting
- Unity 5.5 or later
- Support 2017.x, 2018.x, 2019.x and 2020.x.
This package is available on OpenUPM.
You can install it via openupm-cli.
openupm add com.coffee.unmask
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
{
"dependencies": {
"com.coffee.unmask": "https://github.com/mob-sakai/UnmaskForUGUI.git",
...
},
}
To update the package, change suffix #{version}
to the target version.
- e.g.
"com.coffee.unmask": "https://github.com/mob-sakai/UnmaskForUGUI.git#2.0.0",
Or, use UpmGitExtension to install and update the package.
- Download a source code zip file from Releases page
- Extract it
- Import it into the following directory in your Unity project
Packages
(It works as an embedded package. For Unity 2018.1 or later)Assets
(Legacy way. For Unity 2017.1 or later)
- For Unity 2019.1 or later
- Open
Package Manager
window and selectUI Unmask
package in package list and clickDemo > Import in project
button
- Open
- For Unity 2018.4 or earlier
- Click
Assets/Samples/UI Unmask/Import Demo
from menu
- Click
The assets will be imported into Assets/Samples/UI Unmask/{version}/Demo
.
Open UIUnmask_Demo
scene and play it.
- Add Unmask component to the UI element (Image, RawImage, Text, etc...) under Mask, from
Add Component
in inspector orComponent > UI > Unmask > Unmask
menu. - If you want to unmask the area of the button, follow the steps below:
- Set the button to
Fit Target
in Unmask component. - If the button moves with animation etc., enable
Fit On LateUpdate
in Unmask component. - Add a UnmaskRaycastFilter component to UI element blocking ray.
- Set the Unmask to
Unmask
in UnmaskRaycastFilter component. - Disable
RaycastTarget
of the UI elements, as necessary.
- Set the button to
- Enjoy!
Issues are very valuable to this project.
- Ideas are a valuable source of contributions others can make
- Problems show where this project is lacking
- With a question you show where contributors can improve the user experience
Pull requests are, a great way to get your ideas into this repository.
See CONTRIBUTING.md and develop branch..
This is an open source project that I am developing in my spare time.
If you like it, please support me.
With your support, I can spend more time on development. :)
- MIT
- © UTJ/UCL
- GitHub page : https://github.com/mob-sakai/UnmaskForUGUI
- Releases : https://github.com/mob-sakai/UnmaskForUGUI/releases
- Issue tracker : https://github.com/mob-sakai/UnmaskForUGUI/issues
- Change log : https://github.com/mob-sakai/UnmaskForUGUI/blob/upm/CHANGELOG.md