Actually got a few questions here.
I loaded a bunch of images into a struct, and now I want to unload those images.
I was hoping to just do a myStruct = null, this doesn’t seem to be getting rid of the memory the images used. Is there anyway to make such a thing work? Or must I iterate through every object in the struct and call ‘destroy’ on it?
I am wondering another thing I’m not too sure on. I read in the manual that its best to avoid memory allocations in Update functions. I understand what this means generally, but wonder how intensely must you adhere to this?
Like for example I tend to do alot of
Vector3 newPos = transform.position;
newPos.y += Time.deltaTime;
transform.position = newPos
Should I not be doing something like that in update? Should I make like a temporary ‘globalUtilityVector3’ outside of the update loop, so then I don’t have to create any temporary Vector3’s to read in and out data?
I also do alot of
GUI.TintColor = new Color(1,1,1,.5);
should I not do that either? Should I declare a ‘globalUtilityColor’ outside of Update and then go
globalUtilityColor.a = .5;
GUI.TinColor = globalUtilityColor;
?