Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ComponentResourceReleaseHandler<T>

The signature of a [ReleaseComponentResources ] method: it receives the released component's own data by reference and frees what that component allocated.
Read time 1 minuteLast updated 5 days ago

Definition

public delegate void ComponentResourceReleaseHandler<T>(ref T component) where T : struct, IVisualElementComponent

Remarks

You don't write this delegate yourself. Unity's source generator wraps the component's
[ReleaseComponentResources]
method in one and hands it to the runtime, which invokes it on the main thread once per released component instance.