Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: c# Zombie spawner

  1. #16
    Scavenger
    Join Date
    Jul 2016
    Posts
    42
    Rep Power
    0
    @ HAL9000
    You mean that I create an endless loop,
    which then always stop with yield return WaitForSeconds()?
    Example:

    Code:
    object wait_2 = new WaitForSeconds(2);
     while (true)
     {
     yield return wait_2;
     }
    @StompyNZ
    Yes this is for a api mod.
    Thanks, I will test it and then get back to you.
    Last edited by cookyman; 4 Weeks Ago at 11:43 AM.

  2. #17
    Colony Founder HAL9000's Avatar
    Join Date
    Feb 2014
    Posts
    1,911
    Rep Power
    1
    You can stop coroutines by using "yield break" or just letting the method reach the end of the code (as long as you've yielded at some point in the method). In the example in the other post it spawns 10 entities then the routine ends

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •