UnityCsReference
Unity C# reference source code.
Read-only C# source code for the Unity game engine and editor published by Unity Technologies, letting developers read how built-in Unity APIs and editor tools actually work internally.
This repository contains the C# source code for the Unity game engine and its editor, published by Unity Technologies for reference purposes only. Unity is one of the most widely used game development platforms, and this repository gives developers the ability to read through the actual C# code that powers the engine's internal systems and the editor tools.
The key restriction is that this is a read-only reference, not an open-source release. The license explicitly does not allow modifying or redistributing the code in any form, source or binary. If you want a license to actually modify Unity's source code, including the C++ portions, you need to contact Unity's sales team for a commercial source code agreement.
Because of this read-only nature, the repository does not accept pull requests. If you find something that looks like a bug, the README directs you to file it through Unity's built-in bug reporter rather than GitHub. A link to a Unity blog post explaining the reasoning behind this release model is included in the README.
The published code corresponds to specific Unity versions, and the file and folder layout matches the internal Unity source tree, which can change between versions. The README notes that updates beyond version 6.2.0b4 are currently paused while internal validation processes at Unity are completed, with a plan to resume updates at a later date.
The repository is useful for Unity developers who want to understand how built-in Unity APIs actually work, read the implementation of editor windows, or trace through the source when debugging unexpected engine behavior. Third-party code included in the repository is subject to separate notices documented in the repository.
Where it fits
- Browse Unity's internal C# implementation to understand exactly how a built-in API method works under the hood.
- Debug unexpected Unity engine behavior by tracing the source code of the specific system causing the issue.
- Study how Unity's editor windows are implemented to write better custom editor tools for your game project.
- Find the root cause of a Unity bug before submitting a detailed report through Unity's official bug reporter.