- Home /
How would putting the GUI in several classes affect performance?
Hi,
rather general question in this thread: How does it affect the performance of my game if I put my GUI elements into several classes? Wouldn't OnGUI and Update both be called more often? Doesn't that decrease the framerate?
My GUI class is about 3000 lines long, so it's really time to restructure my code, but I don't know if I should.
Thanks
Why don't you just put it into one partial class that way you can spread it across multiple files?
Just do something like this:
OnGUI(){
CharacterGUI();
Pause$$anonymous$$enuGUI();
}
Function CharacterGUI(){
}
Function Pause$$anonymous$$enuGUI(){
}
Silly me just thought of a similar solution after I posted that. I'll try to put some GUI functions in class B, which is part of class A, but doesn't derive from $$anonymous$$onoBehaviour and see if it works. Thanks.
Your answer
Follow this Question
Related Questions
Can the UI system effectively manage dozens of frequently update sprites? 0 Answers
GUI alternatives ? 1 Answer
Is unity gui good to use 2 Answers
1 UI Text vs 2 UI Text 1 Answer