title: C# debug.log not displaying correct info in method.(using mono and unity)
body: <p>I'm taking on the task of designing a game in unity. I'm not an expert at programming, but I have a fare share of knowledge in Ansi C. So forgive me if my code is C# like.</p>
  
  <p>The method works just fine but for some strange reason the <code>Debug.Log(string.Format("",)</code> displays:</p>
  
  <pre><code>pop_class index value 0 value = 0,
  pop_class index value 1 value = 1,   
  </code></pre>
  
  <p>It displays the i variable and pop_class[i] if i simply type debug.log with the same information outside of method everything displays correctly. <em>Any idea why this is the case?</em> The program is complex enough i don't want to have to wrestle with log files while i'm debugging.</p>
  
  <pre><code>public int pop_generation() //debugger is currently not displaying vars correctly
  {   
      int pop_increase = 1000000;
      int pop_counter = 0;//counts populations assigned by the 1000s
      int high_class_per = 10;
      int mid_class_per = 50;
      int low_class_per = 40;
      int lpoptotal = (faction_pop/100) * low_class_per;
      int lpop_count = 0;
      int mpoptotal = (faction_pop/100) * mid_class_per;
      int hpoptotal = (faction_pop/100) * high_class_per;
      //calucates certain percentage of low class
      int mid_class_pop = (faction_pop/100) * mid_class_per;
      int high_class_pop = (faction_pop/100) * high_class_per;
      System.Random random_now = new System.Random();
      for(int i = 0; i &lt; replimit_check &amp;&amp; pop_counter &lt; faction_pop;i++)
      {
          //keeps total of low class rep population by 1,000s
          if(lpop_count &gt; lpoptotal)
          {
              Debug.Log("Low class generation complete");
              pop_class[i] = 0;
              display_high_class();
              i--;//brings incrementer back once
              break;
          }
          pop_class[i] = random_now.Next(20);
          pop_counter = pop_increase + pop_counter;
          lpop_count = pop_increase + lpop_count;
          if(debug_on)
              Debug.Log(string.Format("Pop_class index value {0} value = {0} ",i,pop_class[i])); //debug.log is bugged
  
      }
      return 0;
  }
  </code></pre>