Class DiagnosticEventCollector | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    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

    PlayerConnectionGuid

    The guid used for the PlayerConnect messaging system.

    Declaration
    public static Guid PlayerConnectionGuid { get; }
    Property Value
    Type Description
    System.Guid

    Methods

    FindOrCreateGlobalInstance()

    Retrieves the global event collector. A new one is created if needed.

    Declaration
    public static DiagnosticEventCollector FindOrCreateGlobalInstance()
    Returns
    Type Description
    DiagnosticEventCollector

    The event collector global instance.

    PostEvent(DiagnosticEvent)

    Send a DiagnosticEvent event to all registered handlers

    Declaration
    public void PostEvent(DiagnosticEvent diagnosticEvent)
    Parameters
    Type Name Description
    DiagnosticEvent diagnosticEvent

    The event to send

    RegisterEventHandler(Action<DiagnosticEvent>, Boolean, Boolean)

    Register for diagnostic events. If there is no collector, this will fail and return false.

    Declaration
    public static bool RegisterEventHandler(Action<DiagnosticEvent> handler, bool register, bool create)
    Parameters
    Type Name Description
    System.Action<DiagnosticEvent> handler

    The handler method action.

    System.Boolean register

    Register or unregister.

    System.Boolean create

    If true, the event collector will be created if needed.

    Returns
    Type Description
    System.Boolean

    True if registered, false if not.

    UnregisterEventHandler(Action<DiagnosticEvent>)

    Unregister event hander

    Declaration
    public void UnregisterEventHandler(Action<DiagnosticEvent> handler)
    Parameters
    Type Name Description
    System.Action<DiagnosticEvent> handler

    Method or delegate that will handle the events

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023