1. May I stop executing of some method without using a timer? I'm asking for analogue of Sleep function. The reason of it is that parameters of a method after its executing are null and I want to avoid allocation of additional variables for these parameters. Also the result of the method depends on decisions made in the part of code, which execution I want to defer.
     
  2. Calytic

    Calytic Community Admin Community Mod

    The oxide/rust ecosystem supports timers and co-routines to do async and cooperative multitasking (psuedo-async) respectively.

    The co-routine option is generally only applicable in situations where the deferred execution requires integrating with some Unity component (such as MonoBehavior). For more information on coroutines, Unity - Manual: Coroutines .

    Timers should be more than sufficient for most plugin use-cases

    We don't have access to System.Threading for security reasons, but in all honesty using sleep is generally discouraged even in conventional programming. There are very few cases where its legitimate to use sleep given the alternatives.