Table of Contents

Class MaterialExtensions

Namespace
Gamelogic.Fx
Assembly
Gamelogic.Fx.dll

Provides extension methods for configuring materials used by Gamelogic Fx effects. These helpers simplify setting keyword collections, texture tiling, color lists, and kernel parameters in a consistent and centralized way.

public static class MaterialExtensions
Inheritance
MaterialExtensions
Inherited Members

Methods

Set(Material, IEnumerable<Keyword>)

Enables or disables shader keywords on the material according to the values in the provided keyword collection.

public static void Set(this Material material, IEnumerable<Keyword> keywords)

Parameters

material Material

The material to modify.

keywords IEnumerable<Keyword>

The set of keywords to apply.

SetIntegerUniversal(Material, int, int)

Sets an integer shader property on the material using the appropriate API depending on the Unity version.

public static void SetIntegerUniversal(this Material material, int shaderPropertyId, int value)

Parameters

material Material

The material to modify.

shaderPropertyId int

The integer ID of the shader property.

value int

The integer value to assign to the shader property.

SetIntegerUniversal(Material, string, int)

Sets an integer shader property on the material using its property name. Automatically resolves the property ID and routes the call to the universal setter.

public static void SetIntegerUniversal(this Material material, string propertyName, int value)

Parameters

material Material

The material to modify.

propertyName string

The name of the shader property.

value int

The integer value to assign to the shader property.

SetKeywordOfGroup(Material, string, string[])

Sets the specified keyword as enabled on the material, while disabling all other keywords in the same group.

public static void SetKeywordOfGroup(this Material material, string enabledKeyword, string[] keywordGroup)

Parameters

material Material

The material to modify.

enabledKeyword string

The keyword to enable on the material.

keywordGroup string[]

The group of keywords that are mutually exclusive, where only one can be enabled at a time. The enabledKeyword must be part of this group.

SetTextureTiling(Material, string, TextureTiling)

Sets a texture and its associated tiling parameters on the material.

public static void SetTextureTiling(this Material material, string textureName, TextureTiling textureTiling)

Parameters

material Material

The material to modify.

textureName string

The shader property name of the texture.

textureTiling TextureTiling

The tiling information and texture asset.