SoftMaskForUGUI
SoftMaskForUGUI copied to clipboard
Images are not updated when alpha is changed by animation
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
I think I found a fix, by adding this to SoftMask.cs:
protected override void OnDidApplyAnimationProperties()
{
hasChanged = true;
}
This helped my issue thanks! If there's a more proper way to do animations using softmask I'd like to know
@marcelopapelgames
Thank you so much... I wasted hours on this problem.
But this fix completely eliminated my issue. thank you!