mob-sakai / UIEffect

UIEffect is an open-source package that allows you to intuitively apply rich UI effects directly from the Inspector or via code. Combine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!
https://mob-sakai.github.io/UIEffect/
MIT License
5.82k stars 797 forks source link

Can dissolve apply to entire hierarchy? #158

Closed efarraro closed 5 years ago

efarraro commented 5 years ago

Can UIDissolve be applied to an entire hierarchy? I see that if I apply UIDissolve directly to a UGUI image, it works great.

But assume I have a parent GameObject and that GameObject has some images below it. Something like this:

GameObject
        Image1
        Image2

If I apply UIDissolve to the GameObject, it doesn't appear to work. Instead, I need to apply UIDissolve to each Image individually. Is there any way to apply UIDissolve at the parent object and have it dissolve all the children?

mob-sakai commented 5 years ago

Hi @efarraro Yes, "hierarchical effect" is one of the features to be implemented. #143 I will implement it in the near future. :)

efarraro commented 5 years ago

Thanks for the quick response @mob-sakai and all your hard work on this project!

github-actions[bot] commented 4 years ago

:tada: This issue has been resolved in version 4.0.0-preview.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

efarraro commented 4 years ago

HI @mob-sakai ! I tried this one after updating my manifest.json to use this version: "com.coffee.ui-effect": "https://github.com/mob-sakai/UIEffect.git#4.0.0-preview.6"

To test it, I created a 2D Unity UI canvas, then added an Image (a white square) and put a smaller child (a red square). I applied the UIDissolve behavior to the parent. The dissolve affected the parent, but did not affect the child.

Is there anything else I might be missing to have the dissolve effect dissolve the whole hierarchy? I saw your recent reboot / 4.0 version. I really appreciate your work on this library - it's one of my favorites!

mob-sakai commented 4 years ago

@efarraro Sorry! I forgot to explain the hierarchical effects feature.

Attach a UISyncEffect component to the child object instead of a UIDissolve component.

mob-sakai commented 4 years ago

However, this feature is experimental. In the future, UISyncEffect may be deprecated and integrated into UIDissolve (or any other effect).

efarraro commented 4 years ago

Understood! I think that's OK for my purposes. Thank you so much for the response!

efarraro commented 4 years ago

One more suggestion that would be nice (if it's possible!) I tried the sync effect and it works as expected. It would be useful to be able to apply to a root object that's not something like an image (for instance, just a plain game object). Something like:

GameObject -> Image -> Image

Right now, you get a popup error in the editor if you try to apply the UIDissolve to something like a plain GameObject. I got around it by just adding an Image to my root game object and disabling (unchecking) the Image script so that it didn't show up. Not sure if this is just a limitation of how the effect is applied (maybe it requires an image?), but I figured I'd mention here, just in case. Most of my hierarchies use a 'plain' GameObject as the root, and it'd be useful to be able to apply the effect to that root.