Blinking Unity UI

This has been used for an in-game notification icon that blinks when a new notification is available.

A Scene bool variable called “NewNotification” triggers this code to be run. During the code block we need to wait for the fading and unfading to complete before the “OnUpdate” tells the block of code to run again. If it tries to start it again before it’s done the blinking cycle, it makes the blink fail. To support this we have a Graph based bool variable called “Blinker”

If Blinker is true our block of code know that the blink hasn’t finished yet and waits until the bool is False again, meaning that it can initiate another blink.

Note: This code block must be set as a co-routine as we use Wait Timers.

Leave a Reply