logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityShaderColorPropertyResolver

    Centralized utility for detecting and caching shader color property names across render pipelines. Supports Built-in Standard, URP Lit, HDRP Lit, and common custom shaders.

    Inheritance
    object
    UnityShaderColorPropertyResolver
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.ProceduralExpression.Infrastructure.Services
    Assembly: Serenity.UnityProceduralExpression.Infrastructure.dll
    Syntax
    public static class UnityShaderColorPropertyResolver

    Methods

    ClearCache()

    Clears the shader property cache. Call this if shaders are reloaded or modified at runtime.

    Declaration
    public static void ClearCache()

    GetTriedPropertyNames()

    Gets all known color property names that were tried during resolution. Useful for diagnostic messages.

    Declaration
    public static string GetTriedPropertyNames()
    Returns
    Type Description
    string

    Comma-separated list of property names.

    ResolveColorProperty(Material, int)

    Resolves the best color property for a material. Results are cached per shader to avoid repeated scanning. Cache validation ensures the cached property exists on the actual material instance.

    Declaration
    public static UnityShaderColorPropertyResolver.ResolvedProperty ResolveColorProperty(Material material, int materialIndex = 0)
    Parameters
    Type Name Description
    Material material

    The material to check.

    int materialIndex

    Material slot index (for logging purposes only).

    Returns
    Type Description
    UnityShaderColorPropertyResolver.ResolvedProperty

    ResolvedProperty with IsValid=true if found, false otherwise.

    In this article
    © 2026 Serenity. All Rights Reserved