概要
using System.Linq; using UnityEditor; using UnityEngine; public class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var paths = Selection .GetFiltered<DefaultAsset>( SelectionMode.DeepAssets ) .Select( x => AssetDatabase.GetAssetPath( x ) ) .Where( x => AssetDatabase.IsValidFolder( x ) ) .ToArray(); foreach ( var path in paths ) { Debug.Log( path ); } } }