1.0.0-preview.11

# [1.0.0-preview.11](https://github.com/mob-sakai/SoftMaskForUGUI/compare/v1.0.0-preview.10...v1.0.0-preview.11) (2020-09-27)

### Bug Fixes

* an exception is thrown when the game view is inactive ([97e5a21](97e5a21b78)), closes [#104](https://github.com/mob-sakai/SoftMaskForUGUI/issues/104)
* graphic.materialForRendering always returns different material ([3f6acec](3f6acec67b)), closes [#103](https://github.com/mob-sakai/SoftMaskForUGUI/issues/103)
pull/122/head
semantic-release-bot 2020-09-27 09:46:58 +00:00
parent ded86d96af
commit 9b6205070f
4 changed files with 21 additions and 10 deletions

View File

@ -1,3 +1,11 @@
# [1.0.0-preview.11](https://github.com/mob-sakai/SoftMaskForUGUI/compare/v1.0.0-preview.10...v1.0.0-preview.11) (2020-09-27)
### Bug Fixes
* an exception is thrown when the game view is inactive ([97e5a21](https://github.com/mob-sakai/SoftMaskForUGUI/commit/97e5a21b784ae9081aec8f17603355eef7e8b2b9)), closes [#104](https://github.com/mob-sakai/SoftMaskForUGUI/issues/104)
* graphic.materialForRendering always returns different material ([3f6acec](https://github.com/mob-sakai/SoftMaskForUGUI/commit/3f6acec67b3c0467670eb8f4b10928fa8724e082)), closes [#103](https://github.com/mob-sakai/SoftMaskForUGUI/issues/103)
# [1.0.0-preview.10](https://github.com/mob-sakai/SoftMaskForUGUI/compare/v1.0.0-preview.9...v1.0.0-preview.10) (2020-09-14) # [1.0.0-preview.10](https://github.com/mob-sakai/SoftMaskForUGUI/compare/v1.0.0-preview.9...v1.0.0-preview.10) (2020-09-14)

View File

@ -674,8 +674,8 @@ namespace Coffee.UISoftMask
{ {
#if UNITY_EDITOR #if UNITY_EDITOR
var res = UnityEditor.UnityStats.screenRes.Split('x'); var res = UnityEditor.UnityStats.screenRes.Split('x');
w = int.Parse(res[0]); w = Mathf.Max(64, int.Parse(res[0]));
h = int.Parse(res[1]); h = Mathf.Max(64, int.Parse(res[1]));
#else #else
w = Screen.width; w = Screen.width;
h = Screen.height; h = Screen.height;

View File

@ -107,17 +107,17 @@ namespace Coffee.UISoftMask
{ {
_softMask = null; _softMask = null;
// Unregister the previous material
MaterialCache.Unregister(_effectMaterialHash);
_effectMaterialHash = k_InvalidHash;
// If this component is disabled, the material is returned as is. // If this component is disabled, the material is returned as is.
if (!isActiveAndEnabled) return baseMaterial;
// If the parents do not have a soft mask component, the material is returned as is. // If the parents do not have a soft mask component, the material is returned as is.
if (!softMask) return baseMaterial; if (!isActiveAndEnabled || !softMask)
{
MaterialCache.Unregister(_effectMaterialHash);
_effectMaterialHash = k_InvalidHash;
return baseMaterial;
}
// Generate soft maskable material. // Generate soft maskable material.
var previousHash = _effectMaterialHash;
_effectMaterialHash = new Hash128( _effectMaterialHash = new Hash128(
(uint) baseMaterial.GetInstanceID(), (uint) baseMaterial.GetInstanceID(),
(uint) softMask.GetInstanceID(), (uint) softMask.GetInstanceID(),
@ -145,6 +145,9 @@ namespace Coffee.UISoftMask
)); ));
}); });
// Unregister the previous material.
MaterialCache.Unregister(previousHash);
return modifiedMaterial; return modifiedMaterial;
} }

View File

@ -2,7 +2,7 @@
"name": "com.coffee.softmask-for-ugui", "name": "com.coffee.softmask-for-ugui",
"displayName": "UI Soft Mask", "displayName": "UI Soft Mask",
"description": "UI Soft Mask is a smooth masking component for Unity UI (uGUI) elements.\nBy using SoftMask instead of the default Mask component, you can beautifully represent the rounded edges of UI elements.", "description": "UI Soft Mask is a smooth masking component for Unity UI (uGUI) elements.\nBy using SoftMask instead of the default Mask component, you can beautifully represent the rounded edges of UI elements.",
"version": "1.0.0-preview.10", "version": "1.0.0-preview.11",
"unity": "2017.1", "unity": "2017.1",
"license": "MIT", "license": "MIT",
"repository": { "repository": {