Add missing events to Unity (eg for transform.position / rotation or gameObject.parent)

If you were ever looking for a way to write more event driven code in Unity you probably found that it’s not so easy at least not with some very basic classes like Transforms.

This tool will help you to add those events directly to Unity classes. It’s highly customisable and you can specify targets yourself, just a few examples

  • Transform position / rotation / scale would be handled with
transform.SetPositionExecuting += (sender, e) => <your handler code>
transform.SetRotationExecuting += (sender, e) => <your handler code>
transform.SetScaleExecuting += (sender, e) => <your handler code>
  • GameObject.parent would be handled with
gameObject.SetParentExecuting += (sender, e) => <your handler code>

All open source and can be found here

The tool works well. Thanks for making it available.

In some UI code, I was setting the anchorPosition of a ScrollRect’s Content object to 0,0, but a few frames later, the anchorPosition was different. I couldn’t figure out what was causing it and suspected it was something in Unity’s UI layout code.

It turns out Unity’s ScrollRect component was changing the anchorPosition in ScrollRect.LateUpdate(). Without this tool, it would have been difficult or impossible to determine the cause.

1 Like

I’ve been working on a visual transform debugger, that makes this tool incredibly simple to use and adds a nice GUI to use.

It’s now available on asset store