以下の内容はhttps://baba-s.hatenablog.com/entry/2019/03/19/224500より取得しました。


【Unity】Unity プロジェクトに含まれているすべてのシーンファイルのパスを取得するエディタ拡張のサンプル

方法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 ビューの順番通りの並びにならない




以上の内容はhttps://baba-s.hatenablog.com/entry/2019/03/19/224500より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14