@ -66,7 +66,7 @@ namespace Fungus.Script
object [ ] attributes = type . GetCustomAttributes ( false ) ;
foreach ( object obj in attributes )
{
CommandCategory Attribute categoryAttr = obj as CommandCategory Attribute ;
CommandInfo Attribute categoryAttr = obj as CommandInfo Attribute ;
if ( categoryAttr ! = null )
{
if ( ! categories . Contains ( categoryAttr . Category ) )
@ -88,20 +88,18 @@ namespace Fungus.Script
string categoryName = categories [ selectedCategoryIndex ] ;
foreach ( System . Type type in subTypes )
{
object [ ] attributes = type . GetCustomAttributes ( fals e) ;
foreach ( object obj in attributes )
CommandInfoAttribute commandInfoAttr = FungusCommandEditor . GetCommandInfo ( typ e) ;
if ( commandInfoAttr = = null )
{
CommandCategoryAttribute categoryAttr = obj as CommandCategoryAttribut e;
if ( categoryAttr ! = null )
{
if ( categoryAttr . Category = = categoryName )
continu e;
}
if ( categoryName = = commandInfoAttr . Category )
{
commandNames . Add ( FungusScriptEditor . GetCommandName ( type ) ) ;
commandNames . Add ( commandInfoAttr . CommandName ) ;
commandTypes . Add ( type ) ;
}
}
}
}
int selectedCommandIndex = EditorGUILayout . Popup ( fungusScript . selectedAddCommandIndex , commandNames . ToArray ( ) ) ;
if ( selectedCategoryIndex ! = fungusScript . selectedCommandCategoryIndex )
@ -152,17 +150,12 @@ namespace Fungus.Script
EditorGUILayout . EndHorizontal ( ) ;
object [ ] helpAttributes = selectedType . GetCustomAttributes ( typeof ( HelpTextAttribute ) , false ) ;
foreach ( object obj in helpAttributes )
{
HelpTextAttribute helpTextAttr = obj as HelpTextAttribute ;
if ( helpTextAttr ! = null )
CommandInfoAttribute infoAttr = FungusCommandEditor . GetCommandInfo ( selectedType ) ;
if ( infoAttr ! = null )
{
GUIStyle labelStyle = new GUIStyle ( EditorStyles . miniLabel ) ;
labelStyle . wordWrap = true ;
EditorGUILayout . HelpBox ( helpTextAttr . HelpText , MessageType . Info ) ;
break ;
}
EditorGUILayout . HelpBox ( infoAttr . HelpText , MessageType . Info ) ;
}
serializedObject . ApplyModifiedProperties ( ) ;