Browse Source

Started refactor and work on textfield for typing command name in block editor

master
desktop-maesty/steve 7 years ago
parent
commit
0a42c8c48d
  1. 11
      Assets/Fungus/Scripts/Editor/BlockEditor.cs

11
Assets/Fungus/Scripts/Editor/BlockEditor.cs

@ -38,6 +38,7 @@ namespace Fungus.EditorUtils
protected Texture2D addIcon;
protected Texture2D duplicateIcon;
protected Texture2D deleteIcon;
protected string commandTextFieldContents = string.Empty;
static List<System.Type> commandTypes;
static List<System.Type> eventHandlerTypes;
@ -308,6 +309,8 @@ namespace Fungus.EditorUtils
GUILayout.FlexibleSpace();
commandTextFieldContents = GUILayout.TextField(commandTextFieldContents, GUILayout.MinWidth(20), GUILayout.MaxWidth(200));
// Add Button
if (GUILayout.Button(addIcon))
{
@ -747,10 +750,18 @@ namespace Fungus.EditorUtils
return filteredAttributes.Values.ToList<KeyValuePair<System.Type, CommandInfoAttribute>>();
}
//Used by GenericMenu Delegate
protected static void AddCommandCallback(object obj)
{
AddCommandOperation commandOperation = obj as AddCommandOperation;
if (commandOperation != null)
{
AddCommandCallback(commandOperation);
}
}
protected static void AddCommandCallback(AddCommandOperation commandOperation)
{
var block = commandOperation.block;
if (block == null)
{

Loading…
Cancel
Save