logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct UnityTransformTargetMapping

    Represents a mapping from a TransformId to a specific Transform on the prefab. Stores relative path for prefab-safe serialization (like bone mappings).

    In the Editor, users select a Transform via ObjectField. The TransformPath is auto-generated from the selection. At runtime, only the path-based fields are used for resolution.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.ProceduralExpression.Infrastructure.Settings
    Assembly: Serenity.UnityProceduralExpression.Infrastructure.dll
    Syntax
    public struct UnityTransformTargetMapping

    Constructors

    UnityTransformTargetMapping(string, string)

    Creates a new transform target mapping.

    Declaration
    public UnityTransformTargetMapping(string transformId, string transformPath)
    Parameters
    Type Name Description
    string transformId

    Unique identifier for the target.

    string transformPath

    Relative path from root to transform.

    Fields

    EditorTransform

    Editor-only reference to the target Transform for UX. Used to auto-generate TransformPath. Stripped from builds automatically.

    Declaration
    public Transform EditorTransform
    Field Value
    Type Description
    Transform

    TransformId

    Stable identifier for this transform target. Used by TransformScaleSequenceLayerSO and other layers to reference this target.

    Declaration
    public string TransformId
    Field Value
    Type Description
    string

    TransformPath

    Relative path from the root transform to the target transform. Empty string means the root transform itself. Uses "/" as separator (e.g., "Body/Head/Eyes"). Auto-generated from EditorTransform selection - do not edit manually.

    Declaration
    public string TransformPath
    Field Value
    Type Description
    string

    Properties

    IsValid

    Returns true if this mapping has valid data.

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    bool

    Methods

    ComputeRelativePath(Transform, Transform)

    Computes the relative path from a root transform to a target transform.

    Declaration
    public static string ComputeRelativePath(Transform root, Transform target)
    Parameters
    Type Name Description
    Transform root

    The root transform.

    Transform target

    The target transform.

    Returns
    Type Description
    string

    Relative path string, or empty if target is root.

    ResolveTransform(Transform)

    Resolves the Transform from the given root transform using the stored path.

    Declaration
    public Transform ResolveTransform(Transform root)
    Parameters
    Type Name Description
    Transform root

    The root transform to search from.

    Returns
    Type Description
    Transform

    The Transform, or null if not found.

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    UpdateFromEditorTransform(Transform)

    Updates TransformPath from EditorTransform. Call this after changing EditorTransform to sync the runtime fields.

    Declaration
    public void UpdateFromEditorTransform(Transform prefabRoot)
    Parameters
    Type Name Description
    Transform prefabRoot

    The prefab root transform for path calculation.

    In this article
    © 2026 Serenity. All Rights Reserved