Class UnsafeUtility | DOTS Runtime | 0.31.0-preview.24
docs.unity3d.com
    Show / Hide Table of Contents

    Class UnsafeUtility

    Inheritance
    Object
    UnsafeUtility
    Namespace: ForPatching
    Syntax
    public static class UnsafeUtility

    Methods

    AddressOf<T>(ref T)

    Declaration
    public static void *AddressOf<T>(ref T output)
        where T : struct
    Parameters
    Type Name Description
    T output
    Returns
    Type Description
    Void*
    Type Parameters
    Name Description
    T

    AlignOf<T>()

    Declaration
    public static int AlignOf<T>()
        where T : struct
    Returns
    Type Description
    Int32
    Type Parameters
    Name Description
    T

    ArrayElementAsRef<T>(Void*, Int32)

    Declaration
    public static T ArrayElementAsRef<T>(void *ptr, int index)
        where T : struct
    Parameters
    Type Name Description
    Void* ptr
    Int32 index
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    As<U, T>(ref U)

    Declaration
    public static T As<U, T>(ref U from)
    Parameters
    Type Name Description
    U from
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    U
    T

    AsRef<T>(Void*)

    Declaration
    public static T AsRef<T>(void *p)
        where T : struct
    Parameters
    Type Name Description
    Void* p
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    CopyPtrToStructure<T>(Void*, out T)

    Declaration
    public static void CopyPtrToStructure<T>(void *ptr, out T output)
        where T : struct
    Parameters
    Type Name Description
    Void* ptr
    T output
    Type Parameters
    Name Description
    T

    CopyStructureToPtr<T>(ref T, Void*)

    Declaration
    public static void CopyStructureToPtr<T>(ref T input, void *ptr)
        where T : struct
    Parameters
    Type Name Description
    T input
    Void* ptr
    Type Parameters
    Name Description
    T

    EnumEquals<T>(T, T)

    Declaration
    public static bool EnumEquals<T>(T a, T b)
        where T : struct
    Parameters
    Type Name Description
    T a
    T b
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    T

    EnumToInt<T>(T)

    Declaration
    public static int EnumToInt<T>(T value)
        where T : struct
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    Int32
    Type Parameters
    Name Description
    T

    ReadArrayElement<T>(Void*, Int32)

    Declaration
    public static T ReadArrayElement<T>(void *source, int index)
    Parameters
    Type Name Description
    Void* source
    Int32 index
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    ReadArrayElementWithStride<T>(Void*, Int32, Int32)

    Declaration
    public static T ReadArrayElementWithStride<T>(void *source, int index, int stride)
    Parameters
    Type Name Description
    Void* source
    Int32 index
    Int32 stride
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    SizeOf<T>()

    Declaration
    public static int SizeOf<T>()
        where T : struct
    Returns
    Type Description
    Int32
    Type Parameters
    Name Description
    T

    WriteArrayElement<T>(Void*, Int32, T)

    Declaration
    public static void WriteArrayElement<T>(void *destination, int index, T value)
    Parameters
    Type Name Description
    Void* destination
    Int32 index
    T value
    Type Parameters
    Name Description
    T

    WriteArrayElementWithStride<T>(Void*, Int32, Int32, T)

    Declaration
    public static void WriteArrayElementWithStride<T>(void *destination, int index, int stride, T value)
    Parameters
    Type Name Description
    Void* destination
    Int32 index
    Int32 stride
    T value
    Type Parameters
    Name Description
    T
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023