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


【Unity】エディタ拡張において Hierarchy に存在するすべてのシーンの情報を取得できる「EditorSceneManager.GetSceneManagerSetup」

概要

f:id:baba_s:20190319225144p:plain

例えば Hierarchy にこのようにシーンが存在する場合に

using System.Text;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;

public static class Example
{
    [MenuItem( "Tools/Hoge" )]
    private static void Hoge()
    {
        var list = EditorSceneManager.GetSceneManagerSetup();

        foreach ( var n in list )
        {
            var sb = new StringBuilder();
            sb.AppendLine( $"path: {n.path}" );
            sb.AppendLine( $"isLoaded: {n.isLoaded}" );
            sb.AppendLine( $"isActive: {n.isActive}" );
            Debug.Log( sb.ToString() );
        }
    }
}

上記のように EditorSceneManager.GetSceneManagerSetup を使用すると

f:id:baba_s:20190319225154p:plain

Hierarchy に存在するすべてのシーンの情報を取得できます

参考サイト様

https://anchan828.github.io/editor-manual/web/callbacks.html




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

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