Application.loadedLevelName 加载的关卡名字

static var loadedLevelName : string

Description描述

The name of the level that was last loaded (Read Only).

最后加载的关卡的名字。(只读)

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		print(Application.loadedLevelName);
	}
}
//打印当前场景名字
print (Application.loadedLevelName);
Page last updated: 2010-12-14