Documentation

Unity Engine

Download Unity

Unity Engine

Unity scripting types

Understand some of the fundamental C# types that Unity provides and their special significance and behavior in the Unity Editor and runtime.
Read time 1 minuteLast updated 2 days ago

Unity has some fundamental built-in classes that are particularly important for scripting. These are classes which your own custom types can inherit from to integrate with Editor and Engine functionality. It's helpful to understand these types, their behavior, and why you should inherit from or use them.
For a complete reference of all the built-in classes and every member available, refer to the Script Reference.

Topic

Description

Object base class in Unity
UnityEngine.Object
is the base class for all objects the Editor can reference from fields in the Inspector window.
MonoBehaviour componentsInherit from
MonoBehaviour
to make your script a component and control the behaviour of GameObjects and make them responsive to events.
ScriptableObject data assetsStore shared data in custom ScriptableObject assets independently from GameObjects, and use that data at runtime and in the Editor.
Unity-specific C# attributesUse Unity-specific C# attributes to define special behavior for your code.

Additional resources