Sharp Coder is reader-supported, meaning when you buy through links on our site, we may earn an affiliate commission.
Working with Arrays and Lists in Unity Code
Unity Programming Tricks
Unity Platform-Specific Compilation
Unity How to Create a Shader
Implementing Keyboard and Mouse Input in Unity
Understanding Functions and Method Calls
How to Become a Better Programmer in Unity

Unity List of Useful Keywords in C#

In the realm of Unity game development, C# is integral. While C# is extensive, certain keywords stand out as particularly beneficial when scripting in Unity. This guide spotlights some of these essential C# keywords used frequently in Unity projects.

Essential C# Keywords in Unity

The following table showcases fundamental keywords for scripting within Unity, defining how objects and actions are managed and manipulated.

'void'Denotes a method that doesn't yield a value. Commonly seen in Unity methods like 'Start()' and 'Update()'.
'public' and 'private'Access modifiers determine visibility. 'public' is accessible externally, while 'private' is restricted to its class.
'class'Declares a class. In Unity, it's often inherited from 'MonoBehaviour' or another class.
'static'Refers to a member that pertains to the class itself, not a specific instance. Useful for patterns like singletons.
'if', 'else', 'else if'Conditional constructs for dynamic decision-making in scripts.
'for', 'foreach'Looping structures for repeated actions, like iterating through lists.
'return'Used in methods to yield a value or end its execution.
'new'Instantiates objects or classes. In Unity, it's used to spawn game objects or lists.
'try', 'catch', 'finally'Exception handling terms for managing errors, ensuring stable gameplay.


Mastering these C# keywords empowers developers to craft intricate and vibrant games, leveraging the full capabilities of the Unity engine.

You Do Not Have To Do Everything Yourself
Search from thousands of ready-to-use Unity assets.
Visit Asset Store