ChrisIceBox , I've been wondering for a while about the garbage collection data that Adventure Creator generates every frame.
I noticed for example this issue was important to find and act on:
Checking this simple checkbox to avoid unnecessary input definition checks every frame, is a huge improvement on mobile platforms, and may be easily missed.
The profiler says that after fixing this setting, AC still creates about 1.1Kb + 0.6kt of GC every frame, which is a lot. On 60FPS that would be around 6Mb of GC per minute.
The profiler OnGUI.BeginGUI(), lists 1.1Kt on it's root level, and points to multiple child components, including 3 from AC:
StateHandler.OnGUI()
MenuPreview.OnGUI()
ActionListManager.OnGUI()
Comments
ActionListManager's OnGUI function is also hidden behind a UNITY_EDITOR check, but the ToString() conversion is a valid point. I shall look into this as part of AC's next update.
AC makes use of OnGUI for more things than just the menu system - camera borders, camera fading, cursor graphics, etc are done within it. I'd say it's crucial for 99% of projects, but as it's used only for displaying purposes - and not input, gameplay etc - it could feasibly be removed if you don't make use of any of those features. Perhaps it'd be possible to introduce some kind of preprocessor around it, so that you can add in e.g. "ACIgnoreOnGUI" to your Scripting Define Symbols box, and AC would bypass it.
private void OnGUI ()
{
RunOnGUI ();
}
public void RunOnGUI ()
{
// OnGUI() contents here
// ...