Check the name of a sprite in c#?

Hi there! I’m curious to know if there’s a way to check for the current sprite’s name using an “if then else”.

For example; if the current sprite name is LightCannon, then fire a red laser. If the name is HeavyCannon, fire a missile, etc.

I realise there are other ways to get this via manipulating layers and what have you, but I’d prefer to do it this way.

Hi! in unity what you may call a ‘sprite’ usually is called a ‘gameobject’ and to check a gameobjects name you can use