docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GhostComponentUtilities

    Utility methods for working with GhostComponents.

    Inheritance
    object
    GhostComponentUtilities
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    public static class GhostComponentUtilities

    Methods

    GetDebugTypeName(ComponentType)

    Retrieve the component name as NativeText. The method is burst compatible.

    Declaration
    public static NativeText.ReadOnly GetDebugTypeName(this ComponentType self)
    Parameters
    Type Name Description
    ComponentType self

    Component type to get the name from

    Returns
    Type Description
    NativeText.ReadOnly

    The component name.

    GetFirstGhostTypeId(NativeArray<GhostInstance>)

    Find the first valid ghost type id in an array of ghost components. Pre-spawned ghosts have type id -1.

    Declaration
    public static int GetFirstGhostTypeId(this NativeArray<GhostInstance> self)
    Parameters
    Type Name Description
    NativeArray<GhostInstance> self

    NativeArray containing ghost type ids

    Returns
    Type Description
    int

    The ghost type index if a ghost with a valid type is found, -1 otherwise

    GetFirstGhostTypeId(NativeArray<GhostInstance>, out int)

    Find the first valid ghost type id in an array of ghost components. Pre-spawned ghosts have type id -1. This method returns -1 if no ghost type id is found.

    Declaration
    public static int GetFirstGhostTypeId(this NativeArray<GhostInstance> self, out int firstGhost)
    Parameters
    Type Name Description
    NativeArray<GhostInstance> self

    NativeArray containing ghost type ids

    int firstGhost

    The first valid ghost type index found will be stored in this variable.

    Returns
    Type Description
    int

    A valid ghost type id, or -1 if no ghost type id was found.

    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)