We are developing a game with Unity3d and recently we switched from native Unity3d UI components to NGUI 2.1.4 . Unfortunately after the switch we are experiencing some problems when we compile and run our game on Flash. When we start the game the memory usage keeps increasing even if the game is idle – i. e. the player does not do anything and non of the “main” game objects is created. The used memory increases with more than 1GB in less than 10 minutes! Without NGUI (we removed all NGUI game objects from our scene) and under the same circumstances (i.e. idle game) the memory usage remains stable and no increase is observed.
Our short investigation (using TheMiner Flash profiler) shows that when NGUI is used the UINode.HasChanged() method is called extremely often and this lead to some copying of memory internally in Unity Engine code. When we commented (just for the sake of testing) the body of this method out, the memory usage increase rate seemed to get lower. Except for UINode.HasChanged() there are some other often used NGUI component methods which lead to this memory copying in Unity Engine.
Could you please give us some advise or directions to overcome this problem? We like very much NGUI and we would like to use it.
Thank you in advance.