Search Unity

question about debug mode in Rider and statics in general

Discussion in 'Scripting' started by laurentlavigne, Mar 12, 2021.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,366
    I have this
    upload_2021-3-11_20-47-2.png
    but this foreach loop only iterates through 3 elements
    do you know what can cause that?
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    If you could post the actual code it'd be helpful, but that "return" that's highlighted there is quite suspicious. Anything that trips whatever if statement that's in, will stop the loop and function dead in its tracks. It's possible that that's supposed to be "continue;" instead (which will skip to the next item in the foreach loop).
     
    laurentlavigne likes this.
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,366
    thank you!
    that's what happens when i turn a local method to a static... I forget to convert the exit logic too...