mob-sakai / SoftMaskForUGUI

Enhance Unity UI (uGUI) with advanced soft-masking features to create more visually appealing effects!
https://github.com/mob-sakai/SoftMaskForUGUI
MIT License
1.97k stars 261 forks source link

[v1] Images are not updated when alpha is changed by animation #118

Closed marcelopapelgames closed 1 month ago

marcelopapelgames commented 3 years ago

I am using the SoftMask to fade in some UI Images. I added SoftMask to a parent object, where an Animation changes the value of alpha along the time. There are children objects with images and SoftMaskables that should "fade in" with the animation but nothing happens. It seems one value for alpha is used for rendering, the value is constantly updated - as seen in debug - but the images are not updated.

If I add code to update() method to verify changes in the alpha value and then call OnValidate(), the magic happens. I did for test purposes only.

https://youtu.be/XSFi4rIt_Z8

Version: Unity 2020

marcelopapelgames commented 3 years ago

I think I found a fix, by adding this to SoftMask.cs:

        protected override void OnDidApplyAnimationProperties()
        {
            hasChanged = true;
        }
KadynCBR commented 2 years ago

This helped my issue thanks! If there's a more proper way to do animations using softmask I'd like to know

KimYC1223 commented 11 months ago

@marcelopapelgames

Thank you so much... I wasted hours on this problem.

But this fix completely eliminated my issue. thank you!

mob-sakai commented 1 month ago

Please try v2: https://github.com/mob-sakai/SoftMaskForUGUI/releases/tag/v2.0.0