ドキュメント

Unity Engine

Unity Engine

GetRuntimeMemorySize(Object)

Returns the runtime memory usage of the resource.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

注意
Deprecated. GetRuntimeMemorySize has been deprecated since it is limited to 2GB. Please use GetRuntimeMemorySizeLong() instead.
public static int GetRuntimeMemorySize(Object o)

Parameters

Returns

Type

Description

int

Remarks

This has been implemented for the following resource types: Mesh, Texture, Audio, Animation and Materials Only available in development players and editor.

Examples

using UnityEngine;using UnityEngine.Profiling;public class Example : MonoBehaviour{ void Update() { Texture[] textures = Resources.FindObjectsOfTypeAll<Texture>(); foreach (Texture t in textures) { Debug.Log("Texture object " + t.name + " using: " + Profiler.GetRuntimeMemorySize(t) + "Bytes"); } }}