Pause InvokeRepeating?

Hello. Is there any way to pause InvokeRepeating for a few seconds and then have it continue again? So if a function is being called every 2 seconds, something happens, and it is not called for 4 seconds, and then it starts back up and is called every 2 seconds again. Thanks

Just a thought, but could you just set your InvokeRepeating to use a variable for the time it takes for it to repeat, and then change the variable as you need to?

For instance, you declare a float called `RepeatDelay` or something, and then for your invocation, just do `InvokeRepeating("TheThingToRepeat", RepeatDelay)`.

It wouldn't be strictly pausing, but if you set the repeat delay extremely high, you could essentially cause it to "pause" for a few seconds. Not sure how this would all work in practice, but at the moment I can't think of anything wrong with it.

Edit: Oh! Another idea I thought of. Place the entire function you're invoking inside of an if statement that checks if a simple switch is on, perhaps a boolean called InvocationIsPaused or whatever you like. That way it would still be invoked, but it wouldn't do anything if the boolean was false. Plus that way it would strictly keep on the same timing and not miss a beat when it unpauses.