docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Auto

    Auto(TP1)

    Profiles a piece of code enclosed within the using statement.

    Declaration
    public ProfilerMarker<TP1>.AutoScope Auto(TP1 p1)
    Parameters
    Type Name Description
    TP1 p1

    Additional context parameter.

    Returns
    Type Description
    ProfilerMarker<TP1>.AutoScope

    IDisposable struct which calls End on Dispose.

    Remarks

    Returns null in Release Players.

    Examples
    using (profilerMarker.Auto(enemies.Count))
    {
        var blastRadius2 = blastRadius * blastRadius;
        for (int i = 0; i < enemies.Count; ++i)
        {
            var r2 = (enemies[i].Pos - blastPos).sqrMagnitude;
            if (r2 < blastRadius2)
                enemies[i].Dispose();
        }
    }
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)