Inspired by LordNed's Diffuse Flash Shader, but fixed it so that it uses the SpriteRenderer's Color
Use this shader if you want to flash/blink a sprite. You would likely want to use this when the player or an enemy is damaged.
- Copy
Diffuse_Flash.shader
into your project - Create a new Material using this Shader
- Find the game object with a Sprite Renderer that you want to flash and change its Material to the new one you created
- Copy
SpriteFlasher.cs
into your project and add it as a new component on your game object - Within your scripts, whenever you need to flash the sprite, you can simply call
GetComponent<SpriteFlasher>().Flash()