void MarkTransformChanged()

book_4_sparkGenerated
code_blocksInput

Description

The MarkTransformChanged method is a public instance method of the TransformProxyComponent class. It is used to notify other components and child objects that the transform of the current object has changed. This notification is crucial for updating components like renderers, which rely on the transform to determine their render positions.

Usage

Call MarkTransformChanged whenever you modify the transform of a GameObject that uses a TransformProxyComponent. This ensures that all dependent components and child objects are aware of the change and can update accordingly.

Example

// Example of using MarkTransformChanged
public class CustomComponent : TransformProxyComponent
{
    public void UpdateTransform()
    {
        // Perform some operations that change the transform
        // ...

        // Notify that the transform has changed
        MarkTransformChanged();
    }
}