From aed20c3cb1643e8b70ec9bebd215a28d04320929 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Wed, 3 Sep 2014 09:50:08 +0100 Subject: [PATCH] Added context menu for command list. Fixed Clear behaviour. --- .../Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs | 5 ++++- Assets/Fungus/FungusScript/Editor/SequenceEditor.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs b/Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs index 9c80acf2..3b96e313 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs @@ -79,7 +79,10 @@ namespace Fungus.Script } public void Clear() { - _arrayProperty.ClearArray(); + while (Count > 0) + { + Remove(0); + } } public void DrawItem(Rect position, int index) diff --git a/Assets/Fungus/FungusScript/Editor/SequenceEditor.cs b/Assets/Fungus/FungusScript/Editor/SequenceEditor.cs index 8423c8e6..09f07a61 100644 --- a/Assets/Fungus/FungusScript/Editor/SequenceEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/SequenceEditor.cs @@ -47,7 +47,7 @@ namespace Fungus.Script SerializedProperty commandListProperty = serializedObject.FindProperty("commandList"); FungusCommandListAdaptor adaptor = new FungusCommandListAdaptor(commandListProperty, 0); - ReorderableListControl.DrawControlFromState(adaptor, null, ReorderableListFlags.DisableContextMenu | ReorderableListFlags.HideAddButton); + ReorderableListControl.DrawControlFromState(adaptor, null, ReorderableListFlags.DisableDuplicateCommand | ReorderableListFlags.HideAddButton); if (Application.isPlaying) {