|
first to clear something out, the function i wrote is probably not the best practice, but it was done fast and it works, but later i discovered that memory used increases every time i use this function...so i guess there is some kind of problem with arrays... can you help me out. memory used increases pretty fast it renders function useless.... here is the code:
} what is happening here is that i want to remove all objects from the scene that are not inside the sphere that has radius determined in other script. so i get all objects (from different systems in the scene- tracking control) that are in the sphere, copy all the objects in the array objectsToShow, then hide all objects in the scene and then unhide that ones that are in the objectsToShow. There is also a case where we copy that array to other global array, but that is irrelevant now, since memory goes up when we are outside that state. it works fine but only things that worries me is that memory leaks....i do not know why, do i need to clear arrays? they should be alive only inside the function. thanks in advance! any help appreciated! cross post to forums: http://forum.unity3d.com/threads/79548-problem-with-memory-leak..-please-help-me-solve-it
(comments are locked)
|
|
You want to not render objects outside a given distance/radius? Why not use the farClipPlane of your Camera for all objects or layerCullDistances for several objects assigned to layers? because i want to remove object that are outside of sphere radius which is in the center of current selection not camera
Feb 25 '11 at 04:35 PM
pretender
(comments are locked)
|
