docs.unity3d.com
    Show / Hide Table of Contents

    Class RemapBehavior<T>

    Remaps components and their serialized references to a MergedModel's hierarchy. Create a subclass that inherits from this when additional remapping behavior is needed when remapping components.

    Inheritance
    Object
    RemapBehavior<T>
    Namespace: Unity.Industrial.Forma.Core.MeshMerge
    Syntax
    public class RemapBehavior<T> : IRemapBehavior where T : Component
    Type Parameters
    Name Description
    T

    Type of Component to remap.

    Remarks

    Must be added to a ComponentRemapMergeBehavior instance to remap components

    Methods

    AddSourceComponent(Component)

    Declaration
    public void AddSourceComponent(Component component)
    Parameters
    Type Name Description
    Component component

    Finalize(MergedModel)

    Declaration
    public void Finalize(MergedModel mergedModel)
    Parameters
    Type Name Description
    MergedModel mergedModel

    Init(ComponentRemapMergeBehavior)

    Declaration
    public virtual void Init(ComponentRemapMergeBehavior mergeBehavior)
    Parameters
    Type Name Description
    ComponentRemapMergeBehavior mergeBehavior

    OnComponentFinalize(MergedModel, T, T)

    Called after OnComponentPostMerge(T, T) for each component that was remapped to the merged model. All dependencies between remapped components should be resolved here (if needed). Base behavior remaps all serialized references.

    Declaration
    protected virtual void OnComponentFinalize(MergedModel mergedModel, T source, T copy)
    Parameters
    Type Name Description
    MergedModel mergedModel

    MergedModel instance that was merged.

    T source

    Source component instance from the original (unmerged) model.

    T copy

    Copied component instance that is remapped to the merged model.

    OnComponentPostMerge(T, T)

    Called after the model has been merged for each component that was remapped to the merged model. Remapping behavior should be done here. Base behavior will copy the source's component values to the copy component.

    Declaration
    protected virtual void OnComponentPostMerge(T source, T copy)
    Parameters
    Type Name Description
    T source

    Source component instance from the original (unmerged) model.

    T copy

    Copied component instance that is remapped to the merged model.

    OnComponentPreMerge(MergedModel, T)

    Called before the model is merged for each component found on the original model. Setup any pre-merge behavior here. Base behavior will add root nodes for the component and each of its serialized Component/GameObject references on the merged model.

    Declaration
    protected virtual void OnComponentPreMerge(MergedModel mergedModel, T source)
    Parameters
    Type Name Description
    MergedModel mergedModel

    MergedModel instance that will be merged.

    T source

    Source component instance from the original (unmerged) model.

    PostMerge(MergedModel)

    Declaration
    public void PostMerge(MergedModel mergedModel)
    Parameters
    Type Name Description
    MergedModel mergedModel

    PreMerge(MergedModel)

    Declaration
    public void PreMerge(MergedModel mergedModel)
    Parameters
    Type Name Description
    MergedModel mergedModel
    Back to top
    Terms of use
    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