diff --git a/Assets/Fungus/Scripts/GameController.cs b/Assets/Fungus/Scripts/GameController.cs index 873286bd..8edf6199 100644 --- a/Assets/Fungus/Scripts/GameController.cs +++ b/Assets/Fungus/Scripts/GameController.cs @@ -278,7 +278,25 @@ namespace Fungus { FadeSprite(spriteRenderer, 1, 0, Vector2.zero); } - + + /** + * Shows or hides a sprite immediately, depending on the visible parameter. + * This method returns immediately but it queues an asynchronous command for later execution. + * @param spriteRenderer The sprite to be modified + * @param visible Shows the sprite when true, hides the sprite when false. + */ + public void ShowSprite(SpriteRenderer spriteRenderer, bool visible) + { + if (visible) + { + ShowSprite(spriteRenderer); + } + else + { + HideSprite(spriteRenderer); + } + } + /** * Fades the transparency of a sprite over a period of time. * This method returns immediately but it queues an asynchronous command for later execution.