How to stop the execution of a function until an specific event occurs

Like said above ^
But I think it would be a perfect timing to start diving into Event Dispatchers & Interfaces for this kind of logic.