Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- function Start () {
- var a=1;
- switch (a)
- {
- case 1:
- // works as expected
- for (var b=5; b>0; b--)
- {
- Debug.Log(b);
- if (b == 2) {
- break;
- }
- }
- Debug.Log("Boom");
- break;
- case 2:
- // fails to detonate!
- var ts : int[] = [5,4,3,2,1,0];
- for (var t in ts)
- {
- Debug.Log(t);
- if (t == 2) {
- break;
- }
- }
- Debug.Log("Boom");
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment