Hi, I’m new to Unity. Just read the reference of Resources.FindObjectsOfTypeAll and tested an empty project with following code:
function OnGUI () {
GUILayout.Label("All " + Resources.FindObjectsOfTypeAll(typeof(UnityEngine.Object)).Length);
GUILayout.Label("Textures " + Resources.FindObjectsOfTypeAll(typeof(Texture)).Length);
GUILayout.Label("AudioClips " + Resources.FindObjectsOfTypeAll(typeof(AudioClip)).Length);
GUILayout.Label("Meshes " + Resources.FindObjectsOfTypeAll(typeof(Mesh)).Length);
GUILayout.Label("Materials " + Resources.FindObjectsOfTypeAll(typeof(Material)).Length);
GUILayout.Label("GameObjects " + Resources.FindObjectsOfTypeAll(typeof(GameObject)).Length);
GUILayout.Label("Components " + Resources.FindObjectsOfTypeAll(typeof(Component)).Length);
}
And I’m pretty surprised it showed 841 textures, 42 meshes (the number changed overtime), 17 materials and 7 game objects already loaded, even there was an MainCamera object visible from the Hierarchy view.
Who does know what these resources are and for?
Thanks in advance!
Jinni
Glad you figured it out.
– cupsster