Class BurstHelper
Helper functions for Burst
Inherited Members
Namespace: Unity.Logging
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 |
---|---|
Boolean | 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 |
---|---|
Boolean |
Exceptions
Type | Condition |
---|---|
Exception | If CheckThatBurstIsEnabled(Boolean) 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 |
---|---|
Boolean | 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(Boolean)
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 |
---|---|---|
Boolean | forceRefresh | If forceRefresh is true, refreshes the cache. |
Returns
Type | Description |
---|---|
Boolean | 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()