Announcements
The Scaleform forum is now read-only. Please head to the Gamedev site for product support.
Scaleform Forum (Read Only)
Scaleform enables developers to leverage the power of the Adobe® Flash® tool set to create powerful user interface environments for video games.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SFCamera generating garbage every frame

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
369 Views, 3 Replies

SFCamera generating garbage every frame

Took us a while to find out why and where.

 

In short, every instance of the OnGUI method generates 336 bytes of garbage and take 0.12 ms of CPU every frames.

 

This is because Unity assume your OnGUI would like to use GUILayout, and therefore creates a new GUILayoutGroup object every frame.

 

To prevent this from occuring, you should do this;

 

private void Start()
{
    useGUILayout = false;
}

 

Scaleform uses the OnGUI method to trap input, but does not use it to display anything, and surely not any GUILayout.

 

You should consider adding this flag to your SFCamera if you like not generating useless garbage every frame.

3 REPLIES 3
Message 2 of 4
RichMC
in reply to: Anonymous

I have forwarded your issue to development.

Richard Mc
Autodesk Gameware
Scaleform Division
Message 3 of 4
Anonymous
in reply to: Anonymous

It's really a GC proglem
Message 4 of 4
RichMC
in reply to: Anonymous

From Scaleform\Unity Development:

 

Thanks for the investigation LightStriker,
 
We’ll incorporate that into SFCamera to reduce the overhead.
Richard Mc
Autodesk Gameware
Scaleform Division

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report