Browse Source

Added GameController.ShowSprite() with bool parameter

master
chrisgregan 11 years ago
parent
commit
58a84737e5
  1. 18
      Assets/Fungus/Scripts/GameController.cs

18
Assets/Fungus/Scripts/GameController.cs

@ -279,6 +279,24 @@ namespace Fungus
FadeSprite(spriteRenderer, 1, 0, Vector2.zero); 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. * Fades the transparency of a sprite over a period of time.
* This method returns immediately but it queues an asynchronous command for later execution. * This method returns immediately but it queues an asynchronous command for later execution.

Loading…
Cancel
Save