using System ;
using System.Collections.Generic ;
using System.ComponentModel ;
using System.Reflection ;
using UnityEditor ;
VisualElement m_FieldsContainer ;
TextElement m_LocationNotes ;
Type m_AssetType ;
Dictionary < string , Type > m_AssetRoleLabelsToTypes = new Dictionary < string , Type > ( ) ;
AssetRoleBase assetRole = >
( AssetRoleBase ) StaticData . GetManagedReferenceValue ( m_AssetRoleProperty ) ;
"None" ,
a = > ReplaceAssetRole ( null ) ,
a = > DropdownMenuAction . Status . Normal ) ;
m_AssetRoleLabelsToTypes . Clear ( ) ;
var label = GetAssetRoleDisplayName ( type ) ;
if ( m_AssetRoleLabelsToTypes . ContainsKey ( label ) )
Debug . LogError ( $"The asset role classes {type.Name} && {m_AssetRoleLabelsToTypes[label].Name} have an identical label: \" { label } \ ". Asset role labels should be unique." ) ;
else
m_AssetRoleLabelsToTypes . Add ( label , type ) ;
GetAssetRoleDisplayName ( type ) ,
label ,
a = > ReplaceAssetRole ( type ) ,
a = > DropdownMenuAction . Status . Normal ) ;
}
static string GetAssetRoleDisplayName ( Type type )
{
return type . Name . Replace ( "AssetRole" , string . Empty ) ;
return ( ( AssetRoleBase ) Activator . CreateInstance ( type ) ) . label ;
}
}
}