Search Unity

Coroutine + Garbage or LateUpdate + Called everyframe?

Discussion in 'Editor & General Support' started by Daylightsburning, Aug 18, 2014.

  1. Daylightsburning

    Daylightsburning

    Joined:
    Oct 24, 2013
    Posts:
    15
    Hi everyone,
    I have an effect which updates when visible (15 FPS is good enough), it works fine but it produces garbage (about 2.3KB every frame) because currently its updating operation is placed in coroutine (due to Coroutine.MoveNext), will this be a problem? I can place its updating operation in LateUpdate but that way its LateUpdate will be called every frame, even when it is invisible. I'm not sure where to place its updating operation, is 2.3KB small enough and can be safely ignored?

    Thank you.
     
    Last edited: Aug 18, 2014