- Home /
How completly remove GUI.Repaint() calls ?
Hi !
The question seems obvious but it's not. How to remove calls made by OnGUI, because of garbage collector spikes, and performances issue of Repaint() function. (ex : http://www.mindthecube.com/wp-content/uploads/2010/09/GUI-bound2.png)
Is there a way to completly remove these calls ?
Of course, i already remove the only OnGUI() call on my scene but calls to Repaint() is still here. I read a rumor that i need to remove every OnGUI() calls of my whole project. Is that true ?
Your snapshot lists several scripts with OnGUI() that are still being called. So either they are still in your scene, or you should check whether they are Editor scripts, or executed in Edit mode, in which case they will always be active.
It's not my snapshot it's an exemple. I will check for calls in edit mode only :)
Hi Benou$$anonymous$$at,
I am not sure if this helps but here goes. I have also attached a pic showing an error and I don't know why that's happening and if I am supposed to do anything about it
Thanks & Regards, Bhanu
Start a new question rather than hijacking an existing QA.
That's nothing, ignore this error. As meat5000 said, start a new question if it's not related to this one ;)
Have a great day !
Thanks a lot but this is related to GUIRepaint so I posted here
Answer by BenouKat · Apr 18, 2013 at 10:45 AM
I was a hidden script which actually call OnGUI function. Removed, and problem gone.
Sorry !
Hi,
I don't have a single OnGUI() in any of my scripts but still getiing 384B GC Alloc. Please help
Thanks & Regards, Bhanu
Sometimes Unity Editor triggers OnGUI(). Can't you check where the function is called by doing a "deep profile" in the profiler ?
Hi Benou$$anonymous$$at,
Thanks a lot for such a quick response and I have attached a pic to show you what's happening and please let me know if you still need me to do deep profile
Thanks & Regards, Bhanu
Your answer
Follow this Question
Related Questions
Filling image without compromises 0 Answers
How to force Unity to Repaint an EditorWindow? 1 Answer
OnGui Function help 1 Answer