Browse Source

Added GameController.ShowSprite() with bool parameter

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

20
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.

Loading…
Cancel
Save