In profiler I see that the most expensive value is GameObject.set_active() which is called when I'm activating objects (it shows about 30% of work of several hundred lines script). Why is it so? Is it possible to reduce it somehow?
asked Jan 21 '11 at 10:15 PM
If you can disable all the components on an object, do that instead (Cameras, Renderers, Scripts...). You can't do this for colliders, but you can make them into triggers, if they hadn't been. If there's some component/logic combination that actually requires you to deactivate the game object, then there's nothing you can do about it. Try to code around that; I find that the disabling and trigger switching method is usually suitable, but it obviously depends on what components you're using.
answered Jan 21 '11 at 11:05 PM