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