Skip to content

Instantly share code, notes, and snippets.

@Ratstail91
Created November 8, 2018 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ratstail91/f9273d08bbcbcc669aaa9e3e911bdfe4 to your computer and use it in GitHub Desktop.
Save Ratstail91/f9273d08bbcbcc669aaa9e3e911bdfe4 to your computer and use it in GitHub Desktop.
void FlashColor(float r, float g, float b, float delay) {
StartCoroutine(FlashColorInternal(r, g, b, delay));
}
IEnumerator FlashColorInternal(float r, float g, float b, float delay) {
spriteRenderer.color = new Color(r, g, b);
yield return new WaitForSeconds(delay);
spriteRenderer.color = new Color(1, 1, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment