Version: 2018.2

ShaderIncludePathAttribute

class in UnityEditor

マニュアルに切り替える

説明

Attach this attribute to a static function that returns an array of extra root shader include paths.

When writing a shader library, it is common to write include files that need to be included in shaders from arbitrary locations. This allows you to specify user-defined shader include paths.

internal static class DefaultShaderIncludes
{
    [ShaderIncludePath]
    public static string[] GetPaths()
    {
        return new[]
        {
            "Assets/ScriptableRenderPipeline/",
            "Assets/SRP/ScriptableRenderPipeline/LightweightPipeline/Shaders"
        };
    }
}