Application.loadedLevelName 加载的关卡名字


static var loadedLevelName : string

Description描述

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

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

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {print(Application.loadedLevelName);}}
//打印当前场景名字print (Application.loadedLevelName);


,