Browse Source

Adding Set Draggable command causes null exception error #111

Fixed a second bug around tags
master
chrisgregan 10 years ago
parent
commit
dce46e416b
  1. 18
      Assets/Fungus/Sprite/Scripts/Commands/SetCollider.cs

18
Assets/Fungus/Sprite/Scripts/Commands/SetCollider.cs

@ -26,10 +26,22 @@ namespace Fungus
SetColliderActive(go);
}
GameObject[] taggedObjects = GameObject.FindGameObjectsWithTag(targetTag);
foreach (GameObject go in taggedObjects)
GameObject[] taggedObjects = null;
try
{
SetColliderActive(go);
taggedObjects = GameObject.FindGameObjectsWithTag(targetTag);
}
catch
{
// The tag has not been declared in this scene
}
if (taggedObjects != null)
{
foreach (GameObject go in taggedObjects)
{
SetColliderActive(go);
}
}
Continue();

Loading…
Cancel
Save