You can exploit the fact that TriggerEvent block actually takes an untyped object reference. You can use this fact this way:
- In the Pawn, add a variable of type “array of object references”, call it attachedFSMs.
- At Pawn initalization, add self to the array and the references of all FSMs that need to be notified. You don’t need a cast to do that, since everything can be safely upcasted to an object reference. If you can’t get proper references during Pawn initialization, make every other FSMs add themselves to the Pawn attachedFSMs array during **their **initialization.
- Add a function TriggerEventDispatch in the Pawn that invokes TriggerEvent in a loop to every object in the attachedFSMs array
- Replace every other call to TriggerEvent to TriggerEventDispatch
If you want to re-use this pattern in other non-pawn objects, just package this behaviour in a component.