Returns the runtime memory usage of the resource.
This has been implemented for the following resource types: Mesh, Texture, Audio, Animation and Materials Only available in development players and editor.
function Update() {
var textures = Resources.FindObjectsOfTypeAll(Texture);
for (var t: Texture in textures)
Debug.Log("Texture object " + t.name + " using: " + Profiling.Profiler.GetRuntimeMemorySize(t) + "Bytes");
}
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { void Update() { Texture[] textures = Resources.FindObjectsOfTypeAll(typeof(Texture)); foreach (Texture t in textures) { Debug.Log("Texture object " + t.name + " using: " + Profiling.Profiler.GetRuntimeMemorySize(t) + "Bytes"); } } }
Did you find this page useful? Please give it a rating: