Hourglass

In Sonic games there are Hourglasses that function as sort of switches, when "activated" (flipped over by an attack) it is usually set for an ammount of time before the switch "deactives". The Hourglasses are usually decorated with eitheer the bobbin symbol or an icon of the sun one one side and the moon on the other.

Sonic Adventure 2
They first appear in Dr. Eggman's pyramid base (Pyramid Cave, Egg Quarters and Death Chamber) where they can open various doors, however the doors will slowly close and when they do the hourglass flip back to normal.

When it comes to the fight against King Boom Boo, one of his minions] conveniantly carries an hourglass, you need to hit the minion in order to get King Boom Boo in his weak shadow state.

Sonic Unleashed
The Hourglasses in Sonic Unleashed function more different in there predecessor, other than the option to change Day or Night in the pause menu when at Town Stages, there is an hourglass in each of the Entrance Stage which has the same function of switching from day or night and from hedgehog to werehog.

Sonic X
In the episode Sonic's Scream Test there was a stone figure of an hourglass simular to the ones in Sonic Adventure 2. It was discoverd on the castle grounds where a movie (starring Linsey Thorndyke) was being shot and one of the cameramen removed the hourglass statue, which awoke the Boo's. The hourglass being restored in it's rightful place made the Boo's depart.