2
\$\begingroup\$

Like the question describes I want to fade out/in all UI-Elements belonging to a parent canvas.

So things I got are :

  • A World-Canvas which contains multiple UI-Items
  • A script which can fade one color depending how close my cursor comes to that item

Things I want :

  • A script which can fade my whole canvas without attaching each single Element with a color property to it

Thoughts :

  • This would most likely work with a script which searches all Text children and Image children of the canvas, but I think that would be rather poorly performing code

I'm totally fine if there is no better solution as the mentioned one, but I would be annoyed if I implement it that way and there is a simple trick I don't know about :)

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

I think you can simply use a Canvas Group component on the top level canvas. It has an Alpha property that you can easily modify with a script.

https://docs.unity3d.com/Manual/class-CanvasGroup.html

\$\endgroup\$
1
  • \$\begingroup\$ That's great I totally missed that! \$\endgroup\$
    – TobiasW
    Commented Oct 28, 2016 at 6:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .