release v0.8.0
commit
bffaed3d78
|
@ -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.
|
||||

|
||||
|
||||
**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)
|
||||
|
|
|
@ -57,8 +57,10 @@ By using SoftMask instead of default Mask, rounded edges of UI elements can be e
|
|||

|
||||
* Support TextMeshPro.
|
||||

|
||||
* Make multiple holes on one background by 'Parts of parent' option
|
||||
* Make multiple holes on one background by 'Parts of parent' option.
|
||||

|
||||
* Camera movement affects the mask rendering when on a World Space Canvas.
|
||||

|
||||
|
||||
|
||||
#### 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",
|
||||
...
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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": {
|
||||
|
|
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -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.
|
||||

|
||||
|
||||
**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)
|
||||
|
|
|
@ -57,8 +57,10 @@ By using SoftMask instead of default Mask, rounded edges of UI elements can be e
|
|||

|
||||
* Support TextMeshPro.
|
||||

|
||||
* Make multiple holes on one background by 'Parts of parent' option
|
||||
* Make multiple holes on one background by 'Parts of parent' option.
|
||||

|
||||
* Camera movement affects the mask rendering when on a World Space Canvas.
|
||||

|
||||
|
||||
|
||||
#### 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",
|
||||
...
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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": {
|
||||
|
|
Loading…
Reference in New Issue