Bearbeiten

Freigeben über


MaterialInstance.AcquireMaterials(Object, Boolean) Method

Definition

Returns all the instantiated materials of this object, similar to Renderer.materials. If any owner is specified the instanced material(s) will not be released until all owners are released. When a material is no longer needed ReleaseMaterial should be called with the matching owner.

public UnityEngine.Material[] AcquireMaterials (UnityEngine.Object owner = default, bool instance = true);
member this.AcquireMaterials : UnityEngine.Object * bool -> UnityEngine.Material[]
Public Function AcquireMaterials (Optional owner As Object = Nothing, Optional instance As Boolean = true) As Material()

Parameters

owner
UnityEngine.Object

An optional owner to track instance ownership.

instance
Boolean

Should this acquisition attempt to instance materials?

Returns

UnityEngine.Material[]

All the instantiated materials.

Applies to