TransformShiftedEvent Class

public class TransformShiftedEvent : UnityEvent<World, Transform, Vector3Double, int>

Represents a Transform Shift event. The intent of this class is solely to add the ability to subscribe to an event in the Unity inspector when the World is shifted. This event is not found on the World class, but is instead found in custom World Shifter classes.

The idea is to allow other scripts to receive notification exactly at the time of shifting. Each transform that is shifted as a result of a world shift fires an event both before and after it is shifted (assuming the custom WorldShifter class is setup correctly).

To subscribe to this event, in a separate MonoBehaviour class, create a public method with System.Object and TransformShiftEventArgs parameters. The name of the method or parameters does not matter. After saving the class, add it to a Game Object in your scene, and then in your World Shifter's inspector, add a new listener by pressing the + button on the event you care about (or both). Drag the MonoBehaviour that will be the listerner to the field that appears, and then select the method you created in the drop down list.

Alternatively, the WorldShifter has Subscribe and Unsubscribe events for hooking up listeners during runtime via code (make sure to Unsubscribe!). Usually this is done in the OnEnable and OnDisable methods of your MonoBehaviour.

The WorldShifter documentation also contains information on how to subscribe to these events, along with more detailed information.

Do not store a reference to the args when your listener is called, as the properties of the args are reset or set to null immediately after the event that uses it is done firing.