Browse Source

Null check in SpriteFader

master
Chris Gregan 9 years ago
parent
commit
b09a34b7fc
  1. 1
      Assets/Fungus/Sprite/Scripts/SpriteFader.cs

1
Assets/Fungus/Sprite/Scripts/SpriteFader.cs

@ -47,6 +47,7 @@ namespace Fungus
// Destroy any existing fader component // Destroy any existing fader component
SpriteFader oldSpriteFader = spriteRenderer.GetComponent<SpriteFader>(); SpriteFader oldSpriteFader = spriteRenderer.GetComponent<SpriteFader>();
if (oldSpriteFader != null)
{ {
Destroy(oldSpriteFader); Destroy(oldSpriteFader);
} }

Loading…
Cancel
Save