docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BurstHelper

    Helper functions for Burst

    Inheritance
    object
    BurstHelper
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Logging
    Assembly: Unity.Logging.dll
    Syntax
    [BurstCompile]
    public static class BurstHelper

    Properties

    IsBurst

    Checks if a method is called from a managed or Burst environment.

    Declaration
    public static bool IsBurst { get; }
    Property Value
    Type Description
    bool

    Returns true if method is called from Burst, not a managed environment

    IsBurstEnabled

    Returns True if Burst is enabled. Can be called from Burst of a managed environments

    Declaration
    public static bool IsBurstEnabled { get; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    Exception

    If CheckThatBurstIsEnabled(bool) was never called before

    IsManaged

    Checks if a method is called from a managed or Burst environment.

    Declaration
    public static bool IsManaged { get; }
    Property Value
    Type Description
    bool

    Returns true if method is called from a managed, not Burst environment

    Methods

    AssertMustBeBurstCompiled()

    Throws / Debug.LogError-s if IsBurstEnabled is true and this is called from a managed environment

    Declaration
    [BurstDiscard]
    public static void AssertMustBeBurstCompiled()
    Exceptions
    Type Condition
    Exception

    If IsBurstEnabled is true and this is called from a managed environment

    CheckThatBurstIsEnabled(bool)

    Checks if Burst is enabled, caches the result. Should be called from a managed environment

    Declaration
    public static bool CheckThatBurstIsEnabled(bool forceRefresh)
    Parameters
    Type Name Description
    bool forceRefresh

    If forceRefresh is true, refreshes the cache.

    Returns
    Type Description
    bool

    True if Burst is enabled

    Exceptions
    Type Condition
    Exception

    If called from Burst environment

    DebugLogIsBurstEnabled()

    Calls Debug.Log that prints if Burst enabled of not

    Declaration
    public static void DebugLogIsBurstEnabled()

    DebugLogIsManaged()

    Calls Debug.Log that prints if this is a managed or Burst environment

    Declaration
    public static void DebugLogIsManaged()
    In This Article
    Back to top
    Copyright © 2025 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)