UIMaterialInstantiator Class

Definition

This is required since UnityUI Graphic elements do not support MaterialPropertyBlocks, and any shader operations can end up modifying the material permanently across all shared instances. To prevent that we create a runtime copy of the material.

public ref class UIMaterialInstantiator
public class UIMaterialInstantiator
type UIMaterialInstantiator = class
Public Class UIMaterialInstantiator
Inheritance
UIMaterialInstantiator

Constructors

UIMaterialInstantiator()

Methods

TryCreateMaterialCopy(Graphic)

Invoke this method to create a copy of the material and use that copy at runtime for Graphic objects to prevent modifying materials in editor or impact shared materials.

Applies to