MonoBehaviour
- Awake
- CancelInvoke
- FixedUpdate
- InvokeRepeating
- Invoke
- IsInvoking
- LateUpdate
- OnApplicationFocus
- OnApplicationPause
- OnApplicationQuit
- OnBecameInvisible
- OnBecameVisible
- OnCollisionEnter
- OnCollisionExit
- OnCollisionStay
- OnConnectedToServer
- OnControllerColliderHit
- OnDestroy
- OnDisable
- OnDisconnectedFromServer
- OnDrawGizmosSelected
- OnDrawGizmos
- OnEnable
- OnFailedToConnectToM...
- OnFailedToConnect
- OnGUI
- OnJointBreak
- OnLevelWasLoaded
- OnMasterServerEvent
- OnMouseDown
- OnMouseDrag
- OnMouseEnter
- OnMouseExit
- OnMouseOver
- OnMouseUpAsButton
- OnMouseUp
- OnNetworkInstantiate
- OnParticleCollision
- OnPlayerConnected
- OnPlayerDisconnected
- OnPostRender
- OnPreCull
- OnPreRender
- OnRenderImage
- OnRenderObject
- OnSerializeNetworkView
- OnServerInitialized
- OnTriggerEnter
- OnTriggerExit
- OnTriggerStay
- OnWillRenderObject
- Reset
- StartCoroutine
- Start
- StopAllCoroutines
- StopCoroutine
- Update
- useGUILayout
MonoBehaviour.OnLevelWasLoaded 当关卡被加载
function OnLevelWasLoaded (level : int) : void
Description描述
This function is called after a new level was loaded.
当一个新关卡被载入时此函数被调用。
/level/ is the index of the level that was loaded. Use the menu item File->Build Settings... to see what scene the index refers to. See Also: Application.LoadLevel
/level/是被加载的关卡的索引。使用菜单项File->Build Settings... 来查看索引引用的是哪个场景。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnLevelWasLoaded(int level) {
if (level == 13)
print("Woohoo");
}
}
// Prints "Woohoo" when level 13 is loaded.
// 当关卡13被加载时打印"Woohoo"
function OnLevelWasLoaded (level : int) {
if (level == 13) {
print ("Woohoo");
}
}
OnLevelWasLoaded can be a co-routine, simply use the yield statement in the function.
OnLevelWasLoaded可以被用作协同程序,在函数中调用yield语句.
最后修改:2011年1月2日 Sunday 16:43