We've moved!

Starting from MRTK 2.6, we are publishing both conceptual docs and API references on docs.microsoft.com. For conceptual docs, please visit our new landing page. For API references, please visit the MRTK-Unity section of the dot net API explorer. Existing content will remain here but will not be updated further.

Search Results for

    Show / Hide Table of Contents

    Class UIMaterialInstantiator

    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.

    Inheritance
    Object
    UIMaterialInstantiator
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.MixedReality.Toolkit.UI
    Assembly: cs.temp.dll.dll
    Syntax
    public class 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.

    Declaration
    public static void TryCreateMaterialCopy(Graphic targetGraphic)
    Parameters
    Type Name Description
    Graphic targetGraphic

    Graphic element that needs to clone its material

    In This Article
    Back to top Generated by DocFX