Application.loadedLevel 加载的关卡

static var loadedLevel : int

Description描述

The level index that was last loaded (Read Only).

最后加载的关卡索引(只读),关卡也就是一个独立的场景。

最后读取的场景代号(只读)

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		print(Application.loadedLevel);
	}
}
//打印当前场景的代号(索引号)
print (Application.loadedLevel);
Page last updated: 2010-12-15