dropMaterialInstance

View sourcedropMaterialInstance<T extends Material>(type: object): ComponentHook

Creates a ComponentHook that releases a material component’s handle when the component is removed.

The returned callback looks up the supplied component type on the entity. It does nothing when the component is absent; otherwise it calls Handle#drop on the component’s handle. The handle release remains deferred according to Handle#drop.

Type Parameters

T extends Material

Parameters

NameDescriptionDefault
type

Concrete material component constructor to look up.

—

Returns

Remove callback for the supplied material component.