Browse Source

Added callback when commands are removed

master
chrisgregan 10 years ago
parent
commit
e25b22aaa8
  1. 2
      Assets/Fungus/FungusScript/Editor/SequenceEditor.cs
  2. 6
      Assets/Fungus/FungusScript/Scripts/Command.cs

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

@ -615,6 +615,8 @@ namespace Fungus
{
if (command == selectedCommand)
{
command.OnCommandRemoved(sequence);
Undo.RecordObject(fungusScript.selectedSequence, "Delete");
fungusScript.selectedSequence.commandList.RemoveAt(i);
Undo.DestroyObjectImmediate(command);

6
Assets/Fungus/FungusScript/Scripts/Command.cs

@ -117,6 +117,12 @@ namespace Fungus
public virtual void OnCommandAdded(Sequence parentSequence)
{}
/**
* Called when the command is deleted from a sequence in the editor.
*/
public virtual void OnCommandRemoved(Sequence parentSequence)
{}
public virtual void OnEnter()
{}

Loading…
Cancel
Save