
If OnAudioFilterRead is implemented, Unity will insert a custom filter into the audio DSP chain.



Sent to all GameObjects before the application quits. Sent to all GameObjects when the application pauses. Sent to all GameObjects when the player gets or loses focus. LateUpdate is called every frame, if the Behaviour is enabled.Ĭallback for setting up animation IK (inverse kinematics).Ĭallback for processing animation movements for modifying root motion. See Also: The Deactivating GameObjects page in the manual.Īwake is called when an enabled script instance is being loaded.įrame-rate independent MonoBehaviour.FixedUpdate message for physics calculations. If none of these functions are present in the script, the Unity Editor does not Note: There is a checkbox for enabling or disabling MonoBehaviour in the Unity Editor. The serialized data also includes internal properties, such as the reference to the MonoScript that tracks the implementation class for the object.įor code samples, see the individual MonoBehaviour methods. When a MonoBehaviour is serialized, the value of C# fields are included according to Unity's Serialization rules. However, this class doesn't support the null-conditional operator ( ?.) and the null-coalescing operator ( ?). For example, it returns true for a "obj = null" check. A MonoBehaviour in this state acts as if it is null. When the parent GameObject is destroyed all components are automatically deleted, including MonoBehaviours.Īfter the underlying component is destroyed, the C# object for the MonoBehaviour remains in memory until garbage is collected. Objects that need to exist independently of a GameObject should derive from ScriptableObject instead.Ī MonoBehaviour can be deleted with Object.Destroy or Object.DestroyImmediate. MonoBehaviours always exist as a Component of a GameObject, and can be instantiated with GameObject.AddComponent.

MonoBehaviour offers life cycle functions that make it easier to develop with Unity.
