docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SharedStatic<T>

    A structure that allows to share mutable static data between C# and HPC#.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Burst
    Assembly: Unity.Burst.dll
    Syntax
    public readonly struct SharedStatic<T> where T : struct
    Type Parameters
    Name Description
    T

    Type of the data to share (must not contain any reference types)

    Properties

    Name Description
    Data

    Get a writable reference to the shared data.

    UnsafeDataPointer

    Get a direct unsafe pointer to the shared data.

    Methods

    Name Description
    GetOrCreate(Type, Type, uint)

    Creates a shared static data for the specified context and sub-context (usable from both C# and HPC#)

    GetOrCreate(Type, uint)

    Creates a shared static data for the specified context (reflection based, only usable from C#, but not from HPC#)

    GetOrCreatePartiallyUnsafeWithHashCode<TSubContext>(uint, long)

    Creates a shared static data unsafely for the specified context and sub-context (usable from both C# and HPC#).

    GetOrCreatePartiallyUnsafeWithSubHashCode<TContext>(uint, long)

    Creates a shared static data unsafely for the specified context and sub-context (usable from both C# and HPC#).

    GetOrCreateUnsafe(uint, long, long)

    Creates a shared static data unsafely for the specified context and sub-context (usable from both C# and HPC#).

    GetOrCreate<TContext>(uint)

    Creates a shared static data for the specified context (usable from both C# and HPC#)

    GetOrCreate<TContext, TSubContext>(uint)

    Creates a shared static data for the specified context and sub-context (usable from both C# and HPC#)

    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)