方法1
using System.Linq; using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var list = AssetDatabase .FindAssets( "t:scene" ) .Select( AssetDatabase.GUIDToAssetPath ) ; foreach ( var n in list ) { Debug.Log( n ); } } }
おそらく Project ビューの順番通りの並びで取得できる
方法2
using System.Linq; using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var list = AssetDatabase .GetAllAssetPaths() .Where( c => c.EndsWith( ".unity" ) ) ; foreach ( var n in list ) { Debug.Log( n ); } } }
おそらく Project ビューの順番通りの並びにならない