2021-05-23unity【Message响应事件】

【Message响应事件】

 

1.【Message 响应事件】(即事件函数)(可从官网查看解释)-(位置:[Scripting API]-UnityEngine--Casses--MonoBehaviour-)(点击任一组件的?问号即可到达官网)

(注:加★星号的表示有讲解)

-   ⒈启动与刷新函数

-       ⑴启动

-           ①Reset()★

-           ②Awake()★

-           ③Start()★

-       ⑵刷新

-           ①FixedUpdate()★

-           ②Update()★

-           ③LateUpdate()★

-   ⒉交互函数

-       ⑴物理Phusic

-           ①OnTriggerEnter()★-(当Collider(碰撞体)进入trigger(触发器)时启用)    -(●使用方法在下面)

-           ②OnTriggerExit ()★-(当Collider(碰撞体)停止触发trigger(触发器)时启用)    -(●使用方法在下面)

-           ③OnTriggerStay()★-(当碰撞体接触触发器时,OnTriggerStay将在每一帧被调用)    -(●使用方法在下面)

-           ④OnCollisionEnter()★-(当Collider / rigidbody触发另一个rigidbody / Collider时,将被调用)-(●使用方法在下面)

-           ⑤OnCollisionExit ()★-(当Collider / rigidbody停止触发另一个rigidbody / Collider时,将被调用)-(●使用方法在下面)

-           ⑥OnCollisionStay () ★(当Collider / rigidbody触发另一个rigidbody / Collider时,将在每一帧被调用)-(●使用方法在下面)

-           ⑦OnControllerColliderhit()★

-           ⑧OnJointBreak ()

-           ⑨OnParticleCollision ()

-       ⑵输入Input(鼠标输入)

-           ①OnMouseEnter () ★

-           ②OnMouseOver () ★

-           ③OnMouseExit()★

-           ④OnMouseDown()★

-           ⑤OnMouseUp()★

-           ⑥OnMouseDrag()★

-           ⑦OnMouseupasButton()★

-       ⑶渲染Rendering

-           ①OnGUI() ★

-           ②OnDrawGizmos()★

-           ③OnDrawGizmosSelected()★

-           ④OnPreCull()

-           ⑤OnPreRender ()

-           ⑥OnPostRender ()

-           ⑦OnRenderObject ()

-           ⑧OnWillRenderObject()

-           ⑨OnRenderImage ()

-       ⑷对象Object(这个上面有)

-           ①OnEnable ()★

-           ②OnDisable()★

-           ③OnDestroy ()★

-       ⑸场景Scene

-           ①OnLevelWasLoaded ()

-       ⑹程序Application

-           ①OnApplicationPause()

-           ②OnApplicationFocus()

-           ③OnApplicationQuit ()

-       ⑺网络Network

-           ①OnPlayerConnected()

-           ②OnServerInitialzed ()

-           ③OnConnectedToServer()

-           ④OnPlayerDisconnected ()

-           ⑤OnDisconnectedFromServer()

-           ⑥OnFailedToConnect ()

-           ⑦OnFailedioConnecToMasterServer()

-           ⑧OnMasterServerEvent()

-           ⑨OnNetworkInstantiate ()

-           ⑩OnSerializeNetworkView ()

-       ⑻动画Animator

-           ①OnAnimatorMove ()

-           ②OnAnimatorlk ()

-       ⑼声音Audio

-           ①OnAudioFilterRead ()

你可能感兴趣的:(unity学习笔记1,游戏开发)