Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetOrCreate

Creates a shared static data for the specified context (usable from both C# and HPC#)
Read time 1 minuteLast updated 10 days ago

Definition

  • Type: Method
  • Namespace: Unity.Burst
  • Assembly: UnityEngine.BurstModule

GetOrCreate<T>(uint)

Creates a shared static data for the specified context (usable from both C# and HPC#)
public static SharedStatic<T> GetOrCreate<TContext>(uint alignment = 0)

Parameters

alignment

Optional alignment

Returns

Type

Description

SharedStatic<T>A shared static for the specified context

GetOrCreate<T, U>(uint)

Creates a shared static data for the specified context and sub-context (usable from both C# and HPC#)
public static SharedStatic<T> GetOrCreate<TContext, TSubContext>(uint alignment = 0)

Parameters

alignment

Optional alignment

Returns

Type

Description

SharedStatic<T>A shared static for the specified context

GetOrCreate(Type, uint)

Creates a shared static data for the specified context (reflection based, only usable from C#, but not from HPC#)
public static SharedStatic<T> GetOrCreate(Type contextType, uint alignment = 0)

Parameters

contextType

A type class that uniquely identifies the this shared data

alignment

Optional alignment

Returns

Type

Description

SharedStatic<T>A shared static for the specified context

GetOrCreate(Type, Type, uint)

Creates a shared static data for the specified context and sub-context (usable from both C# and HPC#)
public static SharedStatic<T> GetOrCreate(Type contextType, Type subContextType, uint alignment = 0)

Parameters

contextType

A type class that uniquely identifies the this shared data

subContextType

A type class that uniquely identifies this shared data within a sub-context of the primary context

alignment

Optional alignment

Returns

Type

Description

SharedStatic<T>A shared static for the specified context