Programming in Unity
Why Unity
Unity uses implementations of the .NET runtime, making C# the most popular game development language. The engine compiles your C# code for each target device, so you can deploy to desktop, mobile, consoles, AR, and VR platforms.
Leverage the productivity boosts of today’s integrated development environments (IDE) such as Visual Studio and Rider. Write and debug code to power your project or even the Unity Editor itself, perform quality and performance analytics, and more.
Empower designers and artists to be more creative, right in Unity. Offload repetitive tasks such as tweaking values or integrating assets, and extend the Editor to better suit your team’s needs.
Find issues and optimize your code with Unity’s profiling and testing tools. Monitor automated crash and exception capture from every platform with Backtrace for Unity. Release game updates effortlessly with content delivery via the cloud.
In Unity, you don’t need to create a real-time 3D framework for your application, because the Unity platform does it for you. Stay focused on creating interactive gameplay in your scripts, then test it out right in the Editor. Unity uses C#, which automatically handles memory management for you: allocating and deallocating memory, using garbage collection to help you avoid memory leaks, and more.
“The Unity Addressable Asset System got us over the line. It squared away our memory issues, and we simply wouldn’t be shipping on Switch anytime soon without it.” – Max McGuire, Technical Director, Unknown Worlds
The Unity platform offers multiple tools for organizing your projects’ code and assets for maximum performance. For example, the Addressables package handles asset management overhead by simplifying content pack creation and deployment. ScriptableObjects are excellent for projects that handle a lot of data that might change throughout production.
“Plastic showed [us] how to set up a branch model at a much more granular and effective level than what we were used to. It’s easy to parse and navigate, people can jump around the project in ways that won’t be destructive.” – Saleem Dabbous, studio director, KO_OP
Plastic SCM is the recommended version control system for Unity game development, offering the best experience when dealing with large binary files, fast workflows, and a simplified interface for non-coders on your team. In-Editor integration is also available for Perforce, and you can choose many other solutions, such as Git.
“With Unity, our artists are more autonomous and less dependent on programmers. On the previous engine, we needed our programmers to do a large part of the visual integration and now the artists can do more on their own. I noticed that programmers are no longer being asked to move things two pixels to the left or do other trivial things like that.” – Catherine Barbeau, Coretech Director, Ludia
Instead of being limited to manipulating values and assets through code, a programmer in Unity can easily edit the Editor interface so artists and designers can tweak gameplay and build scenes directly in the engine. If a designer wants to turn off a behavior, they can just uncheck a box instead of asking you to rewrite code.
“With Arena of Valor, we’re supporting many different hardware configurations in a lot of different countries, and Unity makes it much easier to get the consistency we expect across them all.” – Mellow Yue, Technical Director, Tencent Games
Unity has deep partnerships with all of the major platforms, so you can squeeze the maximum performance out of each of the 20+ deployment options available without the headache of keeping up with the latest device releases. Unity Input System helps you set up controls in one place across platform deployment options and devices, right out of the box.
Once you’ve designed a great game, Unity can help you make it fast and stable. The Unity Editor includes a suite of profiling and optimization tools to help you maximize the available resources for your target platform.
The Unity Profiler gives you performance information about the application, while the Memory Profiler helps you reduce memory usage. The Unity Test Framework allows you to create automated tests to make sure your code runs as intended. Backtrace takes all the hands-on work out of cross-platform crash and exception management, so you can focus on shipping your game.
Resources
If you’re new to C#, this guide can help you take advantage of the .NET framework and benefit from the convenience of a managed environment.
Our engineers work with top mobile studios to improve player experience. This free e-book collects 75+ in-depth tips from real-life situations to help you up your game.
Unity uses the open-source .NET platform to ensure that your games can run on a wide variety of different hardware configurations. Get details on the scripting backends, .NET system libraries, and best practices in the docs.
What’s new
Create optimized, high-performing games by leveraging our newest releases’ under-the-hood enhancements to streamline your coding experience and create with confidence.
Learn how we’ve optimized the core of the Unity Editor so you can iterate quickly through the entire lifetime of your productions, from importing assets to building and deploying a playable game.
Burst is a compiler that translates IL/.NET bytecode into platform-optimized native code. The latest version of the Burst package comes with improvements to both iteration time and the Burst Inspector.
We offer training for professionals in a variety of formats designed to fit into your schedule.