- Home /
Empty Project & Scene, showing up tons of loaded stuff in Unity 4.3.3f1 and not in 4.3.1f1?
So, one of my scenes were a bit suspicious to me, it's kind of slow (compile-wise for example) not like the other scenes, so I went ahead and printed out whatever that's loaded in memory via Resources.FindObjectsOfTypeAll
- I found very amazing results, there were tons of stuff! related and unrelated (around 1900 objects).
Then I created a new project, with an empty scene, and ran a test:
[MenuItem("Test/Leak")]
public static void s()
{
var logFile = @"C:\Users\vexe\Desktop\TEST LOG.log";
if (!File.Exists(logFile)) File.Create(logFile).Close();
UnityEngine.Object[] objList = Resources.FindObjectsOfTypeAll(typeof(UnityEngine.Object));
using (var writer = new StreamWriter(File.Open(logFile, FileMode.Open))) {
foreach (Object obj in objList) {
Debug.Log("Name: " + obj.name + " Type: " + obj.GetType());
var s = "Name: " + obj.name + " Type: " + obj.GetType();
writer.WriteLine(s);
}
}
}
I got 1620 objects! ranging from textures, materials, shaders, etc etc.
A sample log is seen here (Running in Unity 4.3.3f1)
I got the same results with GameObject.FindObjectsOfTypeAll
, and Object.FindObjectsOfTypeAll
In Unity 4.3.1f1, Object.FindObjectsOfTypeAll
printed only around 8 objects, no more!
What's going on here? what are these 'objects'? is this something I should be concerned about? - I was hoping to use this method to debug my scene, but obviously with that amount of output, I can't really make something useful out of it, this makes debugging scenes a lot harder, since I won't know what's relevant from what's not...
I then tried Resources.UnloadUnusedAssets
, and EditorGUI.UnloadUnusedAssets
they didn't do that much, in the case of the empty project, I got 4 less objects...
Thanks!
Your answer
Follow this Question
Related Questions
Building single scene is much too large! 0 Answers
i can't get al the opjects in my scene view.. 1 Answer
[Solved]Game Objects Visible in Game tab but not on Scene tab 3 Answers
Empty scene size problem 0 Answers
Moving from one object to another object either forward or backward in the SAME SCENE 1 Answer