Version: 2020.3
public static string FormatBytes (int bytes);

描述

返回有关字节数的文本。

using UnityEngine;
using UnityEditor;

public class FormatBytesExample : MonoBehaviour { void Start() { // prints "100 bytes" print(EditorUtility.FormatBytes(100));

// prints "2.0 KB" print(EditorUtility.FormatBytes(2048)); } }