Skip to content

Commit 4cb8cae

Browse files
committed
release v1.1.1
2 parents ee21803 + 0b3cbb3 commit 4cb8cae

File tree

8 files changed

+225
-41
lines changed

8 files changed

+225
-41
lines changed

Assets/Coffee/UIExtensions/UnmaskForUGUI/CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Changelog
22

3-
## [1.1.0](https://github.com/mob-sakai/UnmaskForUGUI/tree/1.1.0) (2019-01-25)
3+
## [v1.1.1](https://github.com/mob-sakai/UnmaskForUGUI/tree/v1.1.1) (2019-02-07)
44

5-
[Full Changelog](https://github.com/mob-sakai/UnmaskForUGUI/compare/v1.0.0...1.1.0)
5+
[Full Changelog](https://github.com/mob-sakai/UnmaskForUGUI/compare/v1.1.0...v1.1.1)
6+
7+
**Fixed bugs:**
8+
9+
- UnmaskRaycastFilter is not reliable [\#14](https://github.com/mob-sakai/UnmaskForUGUI/issues/14)
10+
11+
## [v1.1.0](https://github.com/mob-sakai/UnmaskForUGUI/tree/v1.1.0) (2019-01-25)
12+
13+
[Full Changelog](https://github.com/mob-sakai/UnmaskForUGUI/compare/1.1.0...v1.1.0)
614

715
**Install UnmaskForUGUI with Unity Package Manager!**
816

Assets/Coffee/UIExtensions/UnmaskForUGUI/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ Find the manifest.json file in the Packages folder of your project and edit it t
5252
```js
5353
{
5454
"dependencies": {
55-
"com.coffee.unmask": "https://github.com/mob-sakai/UnmaskForUGUI.git#1.1.0",
55+
"com.coffee.unmask": "https://github.com/mob-sakai/UnmaskForUGUI.git#1.1.1",
5656
...
5757
},
5858
}
5959
```
60-
To update the package, change `#1.1.0` to the target version.
60+
To update the package, change `#{version}` to the target version.
6161
Or, use [UpmGitExtension](https://github.com/mob-sakai/UpmGitExtension).
6262

6363
#### Using .unitypackage file (for Unity 5.5+)

Assets/Coffee/UIExtensions/UnmaskForUGUI/Scripts/UnmaskRaycastFilter.cs

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ namespace Coffee.UIExtensions
1313
[AddComponentMenu("UI/Unmask/UnmaskRaycastFilter", 2)]
1414
public class UnmaskRaycastFilter : MonoBehaviour, ICanvasRaycastFilter
1515
{
16-
//################################
17-
// Constant or Static Members.
18-
//################################
19-
Vector3[] s_WorldCorners = new Vector3[4];
20-
21-
2216
//################################
2317
// Serialize Members.
2418
//################################
@@ -48,25 +42,8 @@ public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera)
4842
return true;
4943
}
5044

51-
// Get world corners for the target.
52-
(m_TargetUnmask.transform as RectTransform).GetWorldCorners(s_WorldCorners);
53-
54-
// Convert to screen positions.
55-
var cam = eventCamera ?? Camera.main;
56-
var p = cam.WorldToScreenPoint(sp);
57-
var a = cam.WorldToScreenPoint(s_WorldCorners[0]);
58-
var b = cam.WorldToScreenPoint(s_WorldCorners[1]);
59-
var c = cam.WorldToScreenPoint(s_WorldCorners[2]);
60-
var d = cam.WorldToScreenPoint(s_WorldCorners[3]);
61-
62-
// check left/right side
63-
var ab = Cross(p - a, b - a) < 0.0;
64-
var bc = Cross(p - b, c - b) < 0.0;
65-
var cd = Cross(p - c, d - c) < 0.0;
66-
var da = Cross(p - d, a - d) < 0.0;
67-
6845
// check inside
69-
return ab ^ bc ||bc ^ cd ||cd ^ da;
46+
return !RectTransformUtility.RectangleContainsScreenPoint ((m_TargetUnmask.transform as RectTransform), sp);
7047
}
7148

7249

@@ -80,13 +57,5 @@ public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera)
8057
void OnEnable()
8158
{
8259
}
83-
84-
/// <summary>
85-
/// Cross for Vector2.
86-
/// </summary>
87-
float Cross(Vector2 a, Vector2 b)
88-
{
89-
return a.x * b.y - a.y * b.x;
90-
}
9160
}
9261
}

Assets/Coffee/UIExtensions/UnmaskForUGUI/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "com.coffee.unmask",
33
"displayName": "Unmask for uGUI",
44
"description": "Reverse mask for uGUI element in Unity.",
5-
"version": "1.1.0",
5+
"version": "1.1.1",
66
"unity": "5.5",
77
"license": "MIT",
88
"repository": {

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Changelog
2+
3+
## [v1.1.1](https://github.com/mob-sakai/UnmaskForUGUI/tree/v1.1.1) (2019-02-07)
4+
5+
[Full Changelog](https://github.com/mob-sakai/UnmaskForUGUI/compare/v1.1.0...v1.1.1)
6+
7+
**Fixed bugs:**
8+
9+
- UnmaskRaycastFilter is not reliable [\#14](https://github.com/mob-sakai/UnmaskForUGUI/issues/14)
10+
11+
## [v1.1.0](https://github.com/mob-sakai/UnmaskForUGUI/tree/v1.1.0) (2019-01-25)
12+
13+
[Full Changelog](https://github.com/mob-sakai/UnmaskForUGUI/compare/1.1.0...v1.1.0)
14+
15+
**Install UnmaskForUGUI with Unity Package Manager!**
16+
17+
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
18+
```js
19+
{
20+
"dependencies": {
21+
"com.coffee.unmask": "https://github.com/mob-sakai/UnmaskForUGUI.git#1.1.0",
22+
...
23+
},
24+
}
25+
```
26+
To update the package, change `#1.1.0` to the target version.
27+
28+
**Implemented enhancements:**
29+
30+
- Unmask only for children option [\#11](https://github.com/mob-sakai/UnmaskForUGUI/issues/11)
31+
32+
## [v1.0.0](https://github.com/mob-sakai/UnmaskForUGUI/tree/v1.0.0) (2018-10-18)
33+
34+
[Full Changelog](https://github.com/mob-sakai/UnmaskForUGUI/compare/v0.2.0...v1.0.0)
35+
36+
**Implemented enhancements:**
37+
38+
- Add `Fit On LateUpdate` option [\#10](https://github.com/mob-sakai/UnmaskForUGUI/issues/10)
39+
40+
## [v0.2.0](https://github.com/mob-sakai/UnmaskForUGUI/tree/v0.2.0) (2018-10-16)
41+
42+
[Full Changelog](https://github.com/mob-sakai/UnmaskForUGUI/compare/v0.1.0...v0.2.0)
43+
44+
**Implemented enhancements:**
45+
46+
- Update demo & readme [\#9](https://github.com/mob-sakai/UnmaskForUGUI/issues/9)
47+
48+
## [v0.1.0](https://github.com/mob-sakai/UnmaskForUGUI/tree/v0.1.0) (2018-10-14)
49+
50+
[Full Changelog](https://github.com/mob-sakai/UnmaskForUGUI/compare/987e437b26b83a78d6f54d6cc6778c3181e8e5dc...v0.1.0)
51+
52+
**Implemented enhancements:**
53+
54+
- Add demo [\#5](https://github.com/mob-sakai/UnmaskForUGUI/issues/5)
55+
- Support nesting [\#4](https://github.com/mob-sakai/UnmaskForUGUI/issues/4)
56+
- Following another object [\#3](https://github.com/mob-sakai/UnmaskForUGUI/issues/3)
57+
- Ray through the unmasked rectangle [\#2](https://github.com/mob-sakai/UnmaskForUGUI/issues/2)
58+
- Reverse mask [\#1](https://github.com/mob-sakai/UnmaskForUGUI/issues/1)
59+
60+
61+
62+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

LICENSE.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2018 mob-sakai
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
UnmaskForUGUI
2+
===
3+
4+
Reverse mask for uGUI element in Unity.
5+
6+
![](https://user-images.githubusercontent.com/12690315/51747120-e1d8dc80-20eb-11e9-952e-a67915af1294.png)
7+
8+
[![](https://img.shields.io/github/release/mob-sakai/UnmaskForUGUI.svg?label=latest%20version)](https://github.com/mob-sakai/UnmaskForUGUI/releases)
9+
[![](https://img.shields.io/github/release-date/mob-sakai/UnmaskForUGUI.svg)](https://github.com/mob-sakai/UnmaskForUGUI/releases)
10+
![](https://img.shields.io/badge/unity-5.5%2B-green.svg)
11+
[![](https://img.shields.io/github/license/mob-sakai/UnmaskForUGUI.svg)](https://github.com/mob-sakai/UnmaskForUGUI/blob/upm/LICENSE.txt)
12+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-orange.svg)](http://makeapullrequest.com)
13+
14+
<< [Description](#Description) | [WebGL Demo](#demo) | [Download](https://github.com/mob-sakai/UnmaskForUGUI/releases) | [Install](#install) | [Usage](#usage) >>
15+
16+
### What's new? [See changelog ![](https://img.shields.io/github/release-date/mob-sakai/UnmaskForUGUI.svg?label=last%20updated)](https://github.com/mob-sakai/UnmaskForUGUI/blob/upm/CHANGELOG.md)
17+
### Do you want to receive notifications for new releases? [Watch this repo ![](https://img.shields.io/github/watchers/mob-sakai/UnmaskForUGUI.svg?style=social&label=Watch)](https://github.com/mob-sakai/UnmaskForUGUI/subscription)
18+
19+
20+
21+
<br><br><br><br>
22+
## Description
23+
24+
Unmask provides the following features:
25+
1. Reverse mask
26+
2. Ray through the unmasked rectangle
27+
3. Following another object
28+
4. Support nesting
29+
30+
| Component | Features | Screenshot |
31+
|-|-|-|
32+
|**Unmask**|Reverse masking for parent Mask component.<br><br>**Fit Target / Fit On Late Update:** Fit graphic's transform to target transform on LateUpdate.<br>**Only For Children:** Unmask affects only for children.<br>**Show Unmask Graphic:** Show the graphic that is associated with the unmask render area.|<img src="https://user-images.githubusercontent.com/12690315/51745704-0e3e2a00-20e7-11e9-8da8-5abb1c5193bc.png" width="600px">|
33+
|**UnmaskRaycastFilter**|The ray Passes through the unmasked rectangle.<br>You can click on the unmasked button on the back side.|<img src="https://user-images.githubusercontent.com/12690315/51745958-ebf8dc00-20e7-11e9-8cfc-8174e6ab2b7c.png" width="600px">|
34+
35+
36+
37+
<br><br><br><br>
38+
## Demo
39+
40+
[WebGL Demo](http://mob-sakai.github.io/UnmaskForUGUI)
41+
42+
![demo](https://user-images.githubusercontent.com/12690315/46986251-4e296480-d129-11e8-8e3a-2bb0e5fbe533.gif)
43+
44+
45+
46+
<br><br><br><br>
47+
## Install
48+
49+
#### Using UnityPackageManager (for Unity 2018.3+)
50+
51+
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
52+
```js
53+
{
54+
"dependencies": {
55+
"com.coffee.unmask": "https://github.com/mob-sakai/UnmaskForUGUI.git#1.1.1",
56+
...
57+
},
58+
}
59+
```
60+
To update the package, change `#{version}` to the target version.
61+
Or, use [UpmGitExtension](https://github.com/mob-sakai/UpmGitExtension).
62+
63+
#### Using .unitypackage file (for Unity 5.5+)
64+
65+
Download `*.unitypackage` from [Releases](https://github.com/mob-sakai/UnmaskForUGUI/releases) and import the package into your Unity project.
66+
Select `Assets > Import Package > Custom Package` from the menu.
67+
![](https://user-images.githubusercontent.com/12690315/46570979-edbb5a00-c9a7-11e8-845d-c5ee279effec.png)
68+
69+
70+
71+
<br><br><br><br>
72+
## Usage
73+
74+
1. Add Unmask component to the UI element (Image, RawImage, Text, etc...) under Mask, from `Add Component` in inspector or `Component > UI > Unmask > Unmask` menu.
75+
2. If you want to unmask the area of the button, follow the steps below:
76+
* Set the button to `Fit Target` in Unmask component.
77+
* If the button moves with animation etc., enable `Fit On LateUpdate` in Unmask component.
78+
* Add a UnmaskRaycastFilter component to UI element blocking ray.
79+
* Set the Unmask to `Unmask` in UnmaskRaycastFilter component.
80+
* Disable `RaycastTarget` of the UI elements, as necessary.
81+
![](https://user-images.githubusercontent.com/12690315/46986095-8a0ffa00-d128-11e8-83ac-9151e2d8635d.gif)
82+
3. Enjoy!
83+
84+
85+
##### Requirement
86+
87+
* Unity 5.5+ *(included Unity 2018.x)*
88+
* No other SDK are required
89+
90+
91+
92+
<br><br><br><br>
93+
## Example of using
94+
95+
| Case | Description |Screenshot |
96+
|-|-|-|
97+
|Unmasked text|Black screen is cut out with unmasked text.|![](https://user-images.githubusercontent.com/12690315/46914021-c6c9dd00-cfd2-11e8-9698-6332bac8fef5.png)|
98+
|Hole|Black screen is cut out with unmasked Image.|![](https://user-images.githubusercontent.com/12690315/46985696-9b580700-d126-11e8-9b4a-3d66180c9562.png)|
99+
|Tutorial button|In tutorial, only specific button can be pressed.|![](https://user-images.githubusercontent.com/12690315/46983810-30560280-d11d-11e8-86d5-b25117740df4.png)|
100+
|Transition|Transition effect with silhouette.|![](https://user-images.githubusercontent.com/12690315/46983811-30560280-d11d-11e8-8d81-b38679cf9970.gif)|
101+
102+
103+
104+
<br><br><br><br>
105+
## License
106+
107+
* MIT
108+
* © UTJ/UCL
109+
110+
111+
112+
## Author
113+
114+
[mob-sakai](https://github.com/mob-sakai)
115+
116+
117+
118+
## See Also
119+
120+
* GitHub page : https://github.com/mob-sakai/UnmaskForUGUI
121+
* Releases : https://github.com/mob-sakai/UnmaskForUGUI/releases
122+
* Issue tracker : https://github.com/mob-sakai/UnmaskForUGUI/issues
123+
* Current project : https://github.com/mob-sakai/UnmaskForUGUI/projects/1
124+
* Change log : https://github.com/mob-sakai/UnmaskForUGUI/blob/upm/CHANGELOG.md

package.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "com.coffee.unmask",
3+
"displayName": "Unmask for uGUI",
4+
"description": "Reverse mask for uGUI element in Unity.",
5+
"version": "1.1.1",
6+
"unity": "5.5",
7+
"license": "MIT",
8+
"repository": {
9+
"type": "git",
10+
"url": "git+https://github.com/mob-sakai/UnmaskForUGUI.git"
11+
},
12+
"src": "Assets/Coffee/UIExtensions/UnmaskForUGUI",
13+
"author": "mob-sakai <sakai861104@gmail.com> (https://github.com/mob-sakai)",
14+
"editorOnly": false,
15+
"upmSupport": true,
16+
"dependencies": {
17+
}
18+
}

0 commit comments

Comments
 (0)