ソースコード
using System.Linq;
using UnityEditor;
using UnityEngine;
public class Example
{
[MenuItem( "Tools/Hoge" )]
private static void Hoge()
{
var list = Selection
.GetFiltered<UnityEngine.Object>( SelectionMode.Assets | SelectionMode.DeepAssets )
.Select( x => AssetDatabase.GetAssetPath( x ) )
.SelectMany( x => AssetDatabase.GetDependencies( x ) )
.Where( x => !x.EndsWith( ".cs" ) )
.Distinct()
.OrderBy( x => x )
.ToArray()
;
var result = string.Join( "\n", list );
EditorGUIUtility.systemCopyBuffer = result;
Debug.Log( result );
}
}