Table of Contents

Class TransformMonitor

Monitors changes in global position, rotation, and scale of a Transform.

public class TransformMonitor
Inheritance
TransformMonitor

Remarks

This class gets and potentially sets the Transform.hasChanged property when checking for changes.

Constructors

TransformMonitor(Transform, bool, bool, bool)

Creates a new TransformMonitor

public TransformMonitor(Transform transformToTrack, bool monitorPosition, bool monitorRotation, bool monitorScale)

Parameters

transformToTrack Transform

The transform to monitor

monitorPosition bool

True if the global position of the transform should be monitored

monitorRotation bool

True if the global rotation of the transform should be monitored

monitorScale bool

True if the global scale of the transform should be monitored

Examples

TransformMonitor monitor = new TransformMonitor(transform, true, true, true);
// other operations
if (monitor.CheckForChanges())
{
  //do something
}

Remarks

The TransformMonitor will check for changes in the global position, rotation and scale of the transformToTrack. If any of these changes, HasChanged will be set to true.

Exceptions

ArgumentNullException

Thrown if transformToTrack is null

ArgumentException

Thrown if all tracking parameters are false

See Also

Properties

HasChanged

True if the global position, rotation or scale of the spline was found to have changed at the last check

public bool HasChanged { get; }

Property Value

bool

Methods

CheckForChanges()

Checks if the global position, rotation or scale of the spline has changed since the last check. If so, HasChanged is set to true.

public bool CheckForChanges()

Returns

bool

The same value as HasChanged

Remarks

The method gets and potentially sets the Transform.hasChanged property

ResetMonitoring()

Resets the monitoring. HasChanged is set to false.

public void ResetMonitoring()