Editar

Partilhar via


MaterialInstance.ReleaseMaterial(Object, Boolean) Method

Definition

Relinquishes ownership of a material instance. This should be called when a material is no longer needed after acquire ownership with AcquireMaterial(s).

public void ReleaseMaterial (UnityEngine.Object owner, bool autoDestroy = true);
member this.ReleaseMaterial : UnityEngine.Object * bool -> unit
Public Sub ReleaseMaterial (owner As Object, Optional autoDestroy As Boolean = true)

Parameters

owner
UnityEngine.Object

The same owner which originally acquire ownership via AcquireMaterial(s).

autoDestroy
Boolean

When ownership count hits zero should the MaterialInstance component be destroyed?

Applies to