{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class GhostPrefabCreation | Netcode for Entities | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GhostPrefabCreation

    Helper methods and structs used to configure and create ghost prefabs

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

    Methods

    Name Description
    CollectAllComponents(EntityManager, NativeArray<Entity>, out NativeList<ComponentType>, out NativeArray<int>)

    Helper method to build a list of all component types on all children of a ghost prefab, should not be called directly.

    ConvertToGhostPrefab(EntityManager, Entity, Config, NativeParallelHashMap<Component, ComponentOverride>)

    Converts an entity to a ghost prefab, and registers it with the collection. This method will add the Prefab and LinkedEntityGroup components if they do not already exist. It will also add all component required for a prefab to be used as a ghost, and register it with the GhostCollectionSystem. The blob asset (which is created as part of making it a ghost prefab) is owned (and will be freed by) the GhostCollectionSystem. Thus, the calling code should not free the blob asset. The prefabs must be created exactly the same way on both the client and the server, and they must contain all components. Use component overrides if you want to have some components server or client only.

    FinalizePrefabComponents(Config, EntityManager, Entity, GhostType, NativeArray<Entity>, NativeList<ComponentType>, NativeArray<int>, NetcodeConversionTarget, NativeArray<GhostPrefabType>)

    Strip components which are not used, and add the ones which should always be present on a ghost prefab

    In This Article
    Back to top
    Copyright © 2023 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)