Created
August 29, 2014 10:48
-
-
Save hisasann/b3b09d729e8cae11ce6a to your computer and use it in GitHub Desktop.
Unityのメモリリークを調査するための可視化
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class DetectLeaks : MonoBehaviour | |
{ | |
void OnGUI () | |
{ | |
GUI.color = Color.black; | |
GUILayout.BeginArea (new Rect (10, 80, 400, 800)); | |
GUILayout.Label ("All " + FindObjectsOfTypeAll (typeof(UnityEngine.Object)).Length); | |
GUILayout.Label ("Textures " + FindObjectsOfTypeAll (typeof(Texture)).Length); | |
GUILayout.Label ("AudioClips " + FindObjectsOfTypeAll (typeof(AudioClip)).Length); | |
GUILayout.Label ("Meshes " + FindObjectsOfTypeAll (typeof(Mesh)).Length); | |
GUILayout.Label ("Materials " + FindObjectsOfTypeAll (typeof(Material)).Length); | |
GUILayout.Label ("GameObjects " + FindObjectsOfTypeAll (typeof(GameObject)).Length); | |
GUILayout.Label ("Components " + FindObjectsOfTypeAll (typeof(Component)).Length); | |
GUILayout.EndArea (); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment