Version: 2018.4
LanguageEnglish
  • C#
Method group is Obsolete

Application.GetStreamProgressForLevel

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Obsolete Streaming was a Unity Web Player feature, and is removed. This function is deprecated and always returns 1.0 for valid level indices.

Declaration

public static float GetStreamProgressForLevel(int levelIndex);

Description

How far has the download progressed? [0...1].

In the webplayer this returns the progress of this level.

See Also: CanStreamedLevelBeLoaded function.

using UnityEngine;
using System.Collections;

public class ExampleScript : MonoBehaviour { public float percentageLoaded = 0; public GUIText progressText;

// Print on a guiText how much has been streamed level at index 1 // When finished streaming, print "Level 1 has been fully streamed!" void Start() { progressText = GetComponent<GUIText>(); }

void Update() { if (Application.GetStreamProgressForLevel(1) == 1) { progressText.text = "Level at index 1 has been fully streamed!"; } else { percentageLoaded = Application.GetStreamProgressForLevel(1) * 100; progressText.text = percentageLoaded.ToString(); } } }

Webplayer support is not part of 5.4.0 and later.


Obsolete Streaming was a Unity Web Player feature, and is removed. This function is deprecated and always returns 1.0.

Declaration

public static float GetStreamProgressForLevel(string levelName);

Description

How far has the download progressed? [0...1].

In the webplayer this returns the progress of this level.

See Also: CanStreamedLevelBeLoaded function.

Webplayer support is not part of 5.4.0 and later.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961