TransformShiftEventArgs Class

public sealed class TransformShiftEventArgs : EventArgs

These Event Args are used with the World Shifter class's TransformShifting and TransformShifted events.

You can subscribe to these events (via the inspector or scripting) on whatever World Shifter class you are using in order to receive notification before or after a transform has been shifted as a result of a World Shift.

If you create a custom World Shifter class, in order to utilize these events, you must use the ShiftTransformAndFireEvents method of the World Shifter class, or fire the events yourself using the FireTransformShiftingEvent (before shifting each Transform) and FireTransformShiftedEvent (after shifting each transform) methods. Note, if you use the manual firing method, you MUST NOT use ShiftTransformAndFireEvents as well.

The properties contain useful information, however note that they are only valid within the subscriber method that is passed the event args. If you need to utilize the data after your subscriber method runs, you must store the references or data.

Properties

Name Type Description
ShiftAmount Vector3Double

The amount of the shift. All transforms in the shift cycle will be shifted by this amount if the event is a PreTransformShift event, or have been shifted by this amount if the event is a PostTransformShift event.

TotalTransformsInShiftCycle int

The total number of the transform that will be or have been shifted in this shift cycle. You can use this to trigger logic that should only occur after all transforms have been shifted (also making use of the WasCurrentEventFiredBeforeTransformWasShifted property), by checking if TransformNumberInShiftCycle is = to TotalTransformsInShiftCycle.

Transform Transform

The current transform of the event. It may have been shifted already, or may be set to shift after the current event is done firing. Check WasCurrentEventFiredBeforeTransformWasShifted to find out.

TransformNumberInShiftCycle int

The number of the current transform amongst all transforms in the shift cycle. Will = 1 for the first transform that is shifted, and = TotalTransformsInShiftCycle for the last transform that is shifted. You can use this to trigger logic that should only occur once before or after all transforms have been shifted (also making use of the WasCurrentEventFiredBeforeTransformWasShifted property).

WorldTransformBelongsTo World

The World that the transform belongs to. All transforms in a shift cycle belong to the same world.