コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】Unity 2018.1.0b2 新機能「ShaderUtil.GetAllShaderInfo」

はじめに

Unity 2018.1.0b2 の新機能の「ShaderUtil.GetAllShaderInfo」を使用することで
ビルトインシェーダを含む、すべての利用可能なシェーダの情報を取得できます

使用例

using UnityEditor;
using UnityEngine;

public static class Example
{
    [MenuItem( "Tools/Example" )]
    private static void Hoge()
    {
        var infos = ShaderUtil.GetAllShaderInfo();
        foreach ( var n in infos )
        {
            Debug.Log( n.name );
        }
    }
}

関連記事