Legacy Documentation: Version 5.3
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

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

Sumbission failed

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

Close

Cancel

public static function GetStreamProgressForLevel(levelIndex: int): float;
public static float GetStreamProgressForLevel(int levelIndex);

Parameters

Description

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

In the webplayer this returns the progress of this level.

See Also: CanStreamedLevelBeLoaded function.

	// Print on a guiText how much has been streamed level at index 1
	// When finished streaming, print "Level 1 has been fully streamed!"
	var percentageLoaded : float = 0;
	
	var guiText: GUIText;
    
    
    function Start() {
    	guiText = GetComponent.<GUIText>();
    }
    
	function Update() {
		if(Application.GetStreamProgressForLevel(1) == 1) {
			guiText.text = "Level at index 1 has been fully streamed!";
		} else {
			percentageLoaded = Application.GetStreamProgressForLevel(1) * 100;
			guiText.text = percentageLoaded.ToString();
		}
	}
no example available in C#

public static function GetStreamProgressForLevel(levelName: string): float;
public static float GetStreamProgressForLevel(string levelName);

Parameters

Description

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

In the webplayer this returns the progress of this level.

See Also: CanStreamedLevelBeLoaded function.