Important functions in Unity3d

Source: Internet
Author: User

Update

When Monobehaviour is enabled, its update is called at each frame.

Lateupdate

When behaviour is enabled, its lateupdate is called at each frame.

Fixedupdate

When Monobehaviour is enabled, its fixed time is called once awake the awake is called when a script instance is loaded.

Start

Called only before the update function is called the first time.

Awake

Awake is called when a script instance is loaded .

Reset

Reset to the default value.

Onmouseenter

Called Onmouseenter when the mouse enters the guielement (GUI element) or collider (collision body).

OnMouseOver

Called when the mouse hovers over a guielement (GUI element) or collider (collision body) OnMouseOver

Onmouseexit

Called Onmouseexit when the mouse is moved out of the guielement (GUI element) or collider (collision body).

OnMouseDown

Called onmousedown when the mouse is clicked on a guielement (GUI element) or collider (collision body).

OnMouseUp

Called onmouseup when the user releases the mouse button.

Onmouseupasbutton

Called when the mouse is pressed on the same guielement or Collider, when released.

Onmousedrag

Called Onmousedrag when the user drags the guielement (GUI element) or Collider (collision body) with the mouse.

Ontriggerenter

Ontriggerenter is called when the collider (collision body) enters the trigger (trigger).

Ontriggerexit

Ontriggerexit is called when the collider (collision body) stops triggering the trigger (trigger).

Ontriggerstay

When the collision body touches the trigger, the Ontriggerstay is called at each frame.

Oncollisionenter

Oncollisionenter will be called when this collider/rigidbody triggers another rigidbody/collider.

Oncollisionexit

Oncollisionexit will be called when this collider/rigidbody stops triggering another rigidbody/collider.

Oncollisionstay

When this collider/rigidbody triggers another rigidbody/collider, Oncollisionstay will be called at each frame.

Oncontrollercolliderhit

When moving, Oncontrollercolliderhit is called when the controller collides with the collider.

Onjointbreak

Called when a joint attached to the same object is fractured.

Onparticlecollision

Called when the particle encounters Collider.

Onbecamevisible

Call Onbecamevisible when the renderer (renderer) is visible on any camera.

Onbecameinvisible

Call Onbecameinvisible when the renderer (renderer) is not visible on any camera.

onlevelwasloaded

This function is called when a new level is loaded.

Onenable

This function is called when the object becomes active or active.

Ondisable

This function is called when the object becomes unavailable or inactive.

OnDestroy

This function is called when the Monobehaviour will be destroyed.

Onprecull

Called before the camera is hidden from the scene.

OnPreRender

Called before the camera renders the scene.

Onpostrender

Called after the camera has finished rendering the scene.

Onrenderobject

Called after the camera scene rendering is complete.

Onwillrenderobject

If the object is visible, it will be called by each camera.

Ongui

Called when rendering and handling GUI events.

Onrenderimage

Called when all rendered pictures are finished, to render the picture post effects.

ondrawgizmosselected

If you want to draw gizmos when the object is selected, perform this function.

Ondrawgizmos

If you want to draw a gizmos that can be selected, execute the function.

Onapplicationpause

When the player pauses, it is sent to all the game objects.

Onapplicationfocus

Sent to all game objects when the player gains or loses focus.

Onapplicationquit

Sent to all game objects before the app exits.

onplayerconnected

Called on the server when a new player is successfully connected.

Onserverinitialized

This function is called on the server when Network.initializeserver is called and completed.

Onconnectedtoserver

Called on the client when you successfully connect to the server.

onplayerdisconnected

Called on the server side when a player disconnects from the server.

Ondisconnectedfromserver

Called on the client when a connection is lost or disconnected from the server side.

Onfailedtoconnect

Called on the client when a connection fails for some reason.

Onfailedtoconnecttomasterserver

Called on the client or server side when the event is reported to the autonomic server.

Onmasterserverevent

Called on the client or server side when the event is reported to the autonomic server.

Onnetworkinstantiate

Called when an object uses Network.instantiate for network initialization.

Onserializenetworkview

In a network view script, used to customize variable synchronization.

Important functions in Unity3d

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.