release v0.8.0

pull/55/head
mob-sakai 2019-05-01 21:39:04 +09:00
commit bffaed3d78
8 changed files with 69 additions and 9 deletions

View File

@ -1,5 +1,16 @@
# Changelog
## [v0.8.0](https://github.com/mob-sakai/SoftMaskForUGUI/tree/v0.8.0) (2019-05-01)
[Full Changelog](https://github.com/mob-sakai/SoftMaskForUGUI/compare/v0.7.2...v0.8.0)
Camera movement affects the mask rendering when on a World Space Canvas.
![](https://user-images.githubusercontent.com/12690315/57015752-68540b80-6c51-11e9-8511-2d4534dd9d58.gif)
**Fixed bugs:**
- In overlay mode, mask will be incorrect if the root canvas's parent position are not zero [\#47](https://github.com/mob-sakai/SoftMaskForUGUI/issues/47)
## [v0.7.2](https://github.com/mob-sakai/SoftMaskForUGUI/tree/v0.7.2) (2019-03-16)
[Full Changelog](https://github.com/mob-sakai/SoftMaskForUGUI/compare/v0.7.1...v0.7.2)

View File

@ -57,8 +57,10 @@ By using SoftMask instead of default Mask, rounded edges of UI elements can be e
![](https://user-images.githubusercontent.com/12690315/50284151-7459e080-049b-11e9-9cd3-24fb476766dc.png)
* Support TextMeshPro.
![](https://user-images.githubusercontent.com/12690315/50284145-71f78680-049b-11e9-8be1-ac0ccbdf0144.png)
* Make multiple holes on one background by 'Parts of parent' option
* Make multiple holes on one background by 'Parts of parent' option.
![](https://user-images.githubusercontent.com/12690315/54102470-f5c26e80-440b-11e9-89d1-899aa4dca00d.png)
* Camera movement affects the mask rendering when on a World Space Canvas.
![](https://user-images.githubusercontent.com/12690315/57015752-68540b80-6c51-11e9-8511-2d4534dd9d58.gif)
#### Components
@ -86,7 +88,7 @@ Find the manifest.json file in the Packages folder of your project and edit it t
```js
{
"dependencies": {
"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git#0.7.0",
"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git#0.8.0",
...
},
}

View File

@ -388,7 +388,10 @@ namespace Coffee.UIExtensions
List<SoftMask> _children = new List<SoftMask>();
bool _hasChanged = false;
bool _hasStencilStateChanged = false;
#if !UNITY_2018_1_OR_NEWER
static readonly Dictionary<int, Matrix4x4> s_previousViewProjectionMatrices = new Dictionary<int, Matrix4x4> ();
static readonly Dictionary<int, Matrix4x4> s_nowViewProjectionMatrices = new Dictionary<int, Matrix4x4> ();
#endif
Material material { get { return _material ? _material : _material = new Material(s_SoftMaskShader ? s_SoftMaskShader : s_SoftMaskShader = Resources.Load<Shader>("SoftMask")){ hideFlags = HideFlags.HideAndDontSave }; } }
@ -404,6 +407,27 @@ namespace Coffee.UIExtensions
if (!sm || sm._hasChanged)
continue;
var canvas = sm.graphic.canvas;
if (canvas.renderMode == RenderMode.WorldSpace)
{
var cam = canvas.worldCamera;
Matrix4x4 nowsVP = cam.projectionMatrix * cam.worldToCameraMatrix;
#if UNITY_2018_1_OR_NEWER
Matrix4x4 previousVP = cam.reviousViewProjectionMatrix;
#else
Matrix4x4 previousVP = default(Matrix4x4);
int id = cam.GetInstanceID ();
s_previousViewProjectionMatrices.TryGetValue (id, out previousVP);
s_nowViewProjectionMatrices[id] = nowsVP;
#endif
if (previousVP != nowsVP)
{
sm.hasChanged = true;
}
}
var rt = sm.rectTransform;
if (rt.hasChanged)
{
@ -434,6 +458,16 @@ namespace Coffee.UIExtensions
}
}
}
#if !UNITY_2018_1_OR_NEWER
s_previousViewProjectionMatrices.Clear ();
foreach (int id in s_previousViewProjectionMatrices.Keys)
{
s_previousViewProjectionMatrices [id] = s_nowViewProjectionMatrices [id];
}
s_nowViewProjectionMatrices.Clear ();
#endif
}
/// <summary>
@ -482,7 +516,7 @@ namespace Coffee.UIExtensions
}
else
{
var pos = c.transform.localPosition;
var pos = c.transform.position;
var vm = Matrix4x4.TRS(new Vector3(-pos.x, -pos.y, -1000), Quaternion.identity, new Vector3(1, 1, -1f));
var pm = Matrix4x4.TRS(new Vector3(0, 0, -1), Quaternion.identity, new Vector3(1 / pos.x, 1 / pos.y, -2 / 10000f));
_cb.SetViewProjectionMatrices(vm, pm);

View File

@ -208,7 +208,7 @@ namespace Coffee.UIExtensions
{
var scale = c.transform.localScale.x;
var size = (c.transform as RectTransform).sizeDelta;
var pos = c.transform.localPosition;
var pos = c.transform.position;
mat.SetMatrix(s_GameVPId, Matrix4x4.TRS(new Vector3(0, 0, 0.5f), Quaternion.identity, new Vector3(2 / size.x, 2 / size.y, 0.0005f * scale)));
mat.SetMatrix(s_GameTVPId, Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, new Vector3(1 / pos.x, 1 / pos.y, -2/2000f)) * Matrix4x4.Translate(-pos));
}

View File

@ -2,7 +2,7 @@
"name": "com.coffee.softmask-for-ugui",
"displayName": "Soft Mask For uGUI",
"description": "SoftMask is a smooth masking component for uGUI elements in Unity.\nBy using SoftMask instead of default Mask, rounded edges of UI elements can be expressed beautifully.",
"version": "0.7.2",
"version": "0.8.0",
"unity": "2017.1",
"license": "MIT",
"repository": {

View File

@ -1,5 +1,16 @@
# Changelog
## [v0.8.0](https://github.com/mob-sakai/SoftMaskForUGUI/tree/v0.8.0) (2019-05-01)
[Full Changelog](https://github.com/mob-sakai/SoftMaskForUGUI/compare/v0.7.2...v0.8.0)
Camera movement affects the mask rendering when on a World Space Canvas.
![](https://user-images.githubusercontent.com/12690315/57015752-68540b80-6c51-11e9-8511-2d4534dd9d58.gif)
**Fixed bugs:**
- In overlay mode, mask will be incorrect if the root canvas's parent position are not zero [\#47](https://github.com/mob-sakai/SoftMaskForUGUI/issues/47)
## [v0.7.2](https://github.com/mob-sakai/SoftMaskForUGUI/tree/v0.7.2) (2019-03-16)
[Full Changelog](https://github.com/mob-sakai/SoftMaskForUGUI/compare/v0.7.1...v0.7.2)

View File

@ -57,8 +57,10 @@ By using SoftMask instead of default Mask, rounded edges of UI elements can be e
![](https://user-images.githubusercontent.com/12690315/50284151-7459e080-049b-11e9-9cd3-24fb476766dc.png)
* Support TextMeshPro.
![](https://user-images.githubusercontent.com/12690315/50284145-71f78680-049b-11e9-8be1-ac0ccbdf0144.png)
* Make multiple holes on one background by 'Parts of parent' option
* Make multiple holes on one background by 'Parts of parent' option.
![](https://user-images.githubusercontent.com/12690315/54102470-f5c26e80-440b-11e9-89d1-899aa4dca00d.png)
* Camera movement affects the mask rendering when on a World Space Canvas.
![](https://user-images.githubusercontent.com/12690315/57015752-68540b80-6c51-11e9-8511-2d4534dd9d58.gif)
#### Components
@ -86,7 +88,7 @@ Find the manifest.json file in the Packages folder of your project and edit it t
```js
{
"dependencies": {
"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git#0.7.0",
"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git#0.8.0",
...
},
}

View File

@ -2,7 +2,7 @@
"name": "com.coffee.softmask-for-ugui",
"displayName": "Soft Mask For uGUI",
"description": "SoftMask is a smooth masking component for uGUI elements in Unity.\nBy using SoftMask instead of default Mask, rounded edges of UI elements can be expressed beautifully.",
"version": "0.7.2",
"version": "0.8.0",
"unity": "2017.1",
"license": "MIT",
"repository": {