Inserts a behavior factory into the stunt behavior pipeline at the specified index, so each pipeline seeded from these behaviors gets its own behavior instance instead of sharing one.
public static TStunt InsertBehavior<TStunt>(this TStunt stunt, int index, Func<IStuntBehavior> factory)
where TStunt : IStunt
The stunt to insert the behavior factory to.
The index to insert the behavior factory at.
Function invoked to create the behavior instance.
If the stunt is not constructed yet, the factory is registered and invoked
once per pipeline seeding (e.g. per StuntBuilder.Build call). If the
stunt is already constructed, the factory is invoked immediately and the
resulting instance is inserted into the live pipeline.