Class DiagnosticEventCollector
Collects ResourceManager events and passed them on the registered event handlers. In editor play mode, events are passed directly to the ResourceManager profiler window.
In player builds, events are sent to the editor via the EditorConnection API.
Inheritance
System.Object
DiagnosticEventCollector
Namespace: UnityEngine.ResourceManagement.Diagnostics
Syntax
public class DiagnosticEventCollector : MonoBehaviour
Properties
EditorConnectionMessageId
The message id used to register this class with the EditorConnection
Declaration
public static Guid EditorConnectionMessageId { get; }
Property Value
| Type | Description |
|---|---|
| System.Guid | Guid of message id |
ResourceManagerProfilerEventsEnabled
Get or set whether ResourceManager events are enabled
Declaration
public static bool ResourceManagerProfilerEventsEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Enabled state of profiler events |
Methods
PostEvent(DiagnosticEvent)
Send a DiagnosticEvent event to all registered handlers
Declaration
public static void PostEvent(DiagnosticEvent diagnosticEvent)
Parameters
| Type | Name | Description |
|---|---|---|
| DiagnosticEvent | diagnosticEvent | The event to send |
RegisterEventHandler(Action<DiagnosticEvent>)
Register event handler
Declaration
public static void RegisterEventHandler(Action<DiagnosticEvent> handler)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<DiagnosticEvent> | handler | Method or delegate that will handle the events |
UnregisterEventHandler(Action<DiagnosticEvent>)
Unregister event hander
Declaration
public static void UnregisterEventHandler(Action<DiagnosticEvent> handler)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<DiagnosticEvent> | handler | Method or delegate that will handle the events |