In the case of primitive types, since it is allocated on the stack area, it is not related to memory leaks, right? If I'm mistaken/wrong, please let me know.// reset detections which might have been turned of by pop out prevention previously
_gen1.detectCollisions = true;
_gen2.detectCollisions = true;
_gen3.detectCollisions = true;
// avoid pop out
bool popOutDetected = _avoidPopOutJSON.val &&
.......
That bool define right in the middle of FixedUpdate() means every loop it re-allocates some memory - should define the variable outside the loop in the init section then re-use it.
I hope you don't misunderstand, I just want to know exactly how to avoid leaks.
Last edited: