言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

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);
public static def GetStreamProgressForLevel(levelIndex as int) as float

Description

どこまでダウンロードされているかを返します(0 から1)

webplayerではこれはレベルの進捗を返します。 See Also: CanStreamedLevelBeLoaded 関数.

	// 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;

	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();
		}
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public float percentageLoaded = 0;
    void 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();
        }
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public percentageLoaded as float = 0

	def Update() as void:
		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()

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

Description

どこまでダウンロードされているかを返します(0 から1)

webplayerではこれはレベルの進捗を返します。 See Also: CanStreamedLevelBeLoaded 関数.

	// Print on a guiText how much has been streamed "Level1"
	// When finished streaming, print "Level1 has been fully streamed!"
	var percentageLoaded : float = 0;

	function Update() {
		if(Application.GetStreamProgressForLevel("Level1") == 1) {
			guiText.text = "Level 1 has been fully streamed!";
		} else {
			percentageLoaded = Application.GetStreamProgressForLevel("Level1") * 100;
			guiText.text = percentageLoaded.ToString();
		}
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public float percentageLoaded = 0;
    void Update() {
        if (Application.GetStreamProgressForLevel("Level1") == 1)
            guiText.text = "Level 1 has been fully streamed!";
        else {
            percentageLoaded = Application.GetStreamProgressForLevel("Level1") * 100;
            guiText.text = percentageLoaded.ToString();
        }
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public percentageLoaded as float = 0

	def Update() as void:
		if Application.GetStreamProgressForLevel('Level1') == 1:
			guiText.text = 'Level 1 has been fully streamed!'
		else:
			percentageLoaded = (Application.GetStreamProgressForLevel('Level1') * 100)
			guiText.text = percentageLoaded.ToString()