2D Toolkit Forum

2D Toolkit => Support => Topic started by: edb on April 02, 2015, 07:59:02 pm

Title: tk2dUIManager.Update() GC Allocs
Post by: edb on April 02, 2015, 07:59:02 pm
I'm profiling my game on an Android tablet and found some GC Allocs of 56B in tk2dUIManager.Update() whenever I touched the screen.

I traced it down to tk2dUiManager/CheckInputs() and this call:

      foreach (Touch touch in Input.touches)

I changed it to:

        for (int i=0;  i<Input.touchCount;  i++)
        {
          Touch touch = Input.GetTouch(i);


and that made the GC Allocs go away.


Title: Re: tk2dUIManager.Update() GC Allocs
Post by: unikronsoftware on April 06, 2015, 01:22:42 pm
Thanks for that, fixed it for the next release