Comments (4)
I presume the problem is when OnRectTransformDimensionsChange is called in the soft mask component
from softmaskforugui.
Hey, I have got the same issue in my project.
I have discovered that de-activating and re-activating a parent of the broken SoftMask GameObjects fix them.
So I have just made a dirty workaround with the following script.
It simply de-activate and re-activate its own gameObject when a RectTransformDimensionsChange happen.
Of course you have to put this Script on a parent of the broken SoftMask GameObjects.
using UnityEngine;
[HelpURL("https://github.com/mob-sakai/SoftMaskForUGUI/issues/157#issuecomment-1691486145")]
public class ReActivateOnResize : MonoBehaviour {
void Start() { }
void OnRectTransformDimensionsChange() {
if(isActiveAndEnabled) {
gameObject.SetActive(false);
gameObject.SetActive(true);
}
}
}
This is not perfect:
- the GameObjects disappear temporally while the window is resized
- side effects might occur with other Scripts/UI components expecting the GameObjects to be active
Of course instead of using my script you can replace all default Unity Masks by SoftMasks, but in my case I prefer using SoftMasks only when necessary (to avoid putting SoftMaskable components everywhere).
from softmaskforugui.
I resolved this issue by adding
protected void OnRectTransformDimensionsChange()
{
OnValidate();
}
to SoftMaskable.cs
from softmaskforugui.
Related Issues (20)
- "Part of parent" option is unreliable
- In Scene view, soft mask isn't displayed outside of the Camera frustrum, using URP HOT 1
- Specifying a maskable in the inspector outside the mask
- Error when importing this asset + SoftMaskable not working HOT 1
- Can't use Text Mesh Pro UGUI Text as a SoftMask HOT 1
- Textmeshpro special characters not handled HOT 1
- How to use the inverted mask? HOT 2
- [v1] Soft mask doesn't work, Unity 2020.3.33f1 HOT 2
- ParticleAttractor support for List of Particles and allow them to be attached and detached at runtime HOT 1
- Unable to get Soft Mask to work - console fills with errors HOT 2
- [v1] Masked UI image vanishes when dragged HOT 2
- [v1] I can't make a material for the Image based on the Default SoftMaskable shader HOT 2
- [v1] When creating AssetBundle and loading them into an Android application, SoftMaskUI does not work. HOT 4
- [v1] NullReferenceException when adding SoftMask component HOT 1
- [v1] All SoftMasks disappear when screen orientation is changed HOT 7
- SoftMaskForUGUI v2 HOT 5
- [v1] Using this soft mask with text mesh pro in unity 2023 makes the text blocky like the shader dosen't work HOT 7
- [v1] Non-maskable TMPro text masks until "Maskable" re-disabled HOT 2
- [v1] Masked elements are off-set if canvas is not full screen HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from softmaskforugui.