Adds a behavior factory to a stunt, so each pipeline seeded from these behaviors gets its own behavior instance instead of sharing one.
public static TStunt AddBehavior<TStunt>(this TStunt stunt, Func<IStuntBehavior> factory)
where TStunt : IStunt
The stunt to add the behavior factory to.
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 added to the live pipeline.