Need advice to make code efficient

hi to all,

I have a singlton class in my project that contains properties in which I am using Texture variables, GUIStyle and others as well.

If we make object of a singlton class in the script of an object and use the Texture properties. The thing that i wish to ask is that Are all textures are loaded in memory with this object and if so then

make the object of this singlton class in the multiple game objects. will those texture be loaded multiple times ???

thanks in advance

unityboy

The simplest way to make it efficient is stop using OnGUI and GUIStyles etc right away.

Will save you 10 - 50% of your frametime.

And no, textures aren’t loaded multiple times.

thanks for replying.

than what else to use for displaying image back grounds. and to apply GUIStyles.

You can not use GUIStyles without ongui

What is commonly recommend is SpriteUI for example which is a single drawcall system that allows you to create the UI from sections of a single image