Browse Source

Safely handle command class being renamed

master
chrisgregan 10 years ago
parent
commit
f3f49bdc8a
  1. 4
      Assets/Fungus/FungusScript/Editor/SequenceEditor.cs
  2. 5
      Assets/Fungus/FungusScript/Scripts/Sequence.cs

4
Assets/Fungus/FungusScript/Editor/SequenceEditor.cs

@ -58,6 +58,10 @@ namespace Fungus
// Make sure each command has a reference to its parent sequence
foreach (Command command in sequence.commandList)
{
if (command == null) // Will be deleted from the list later on
{
continue;
}
command.parentSequence = sequence;
}

5
Assets/Fungus/FungusScript/Scripts/Sequence.cs

@ -61,6 +61,11 @@ namespace Fungus
int index = 0;
foreach (Command command in commandList)
{
if (command == null) // Null entry will be deleted automatically later
{
continue;
}
command.commandIndex = index++;
}
}

Loading…
Cancel
Save