Version: 2020.1
Method group is Obsolete

Application.streamedBytes

切换到手册
Obsolete public static int streamedBytes ;

描述

从主 Unity Web 流下载的字节数(只读)。

在 WebPlayer 中,该属性返回到目前为止下载的压缩字节数。 在独立平台播放器或编辑器中,该属性始终返回 0。

另请参阅:GetStreamProgressForLevel 函数。

using UnityEngine;
using UnityEngine.UI;

class Example : MonoBehaviour { Text byteDisplay; void Start() { byteDisplay = GetComponent<Text>(); }

// Prints to a Text UI how many bytes we have streamed. void Update() { byteDisplay.text = "Streamed Bytes: " + Application.streamedBytes.ToString(); } }

请注意,从 5.4.0 开始,已不再继续提供 WebPlayer 支持。