发布Unity C#源代码

This Friday we published the Unity engine and editor C# source code on GitHub, under a reference-only license.

这个星期五,我们以仅供参考的许可在GitHub上发布了Unity引擎和编辑器C#源代码。

等等...什么? (Wait… what?)

It’s always been possible to disassemble the Unity .NET assemblies, and our terms of service explicitly permits doing so, for the purpose of understanding or improving your projects made with Unity. But there are two obvious disadvantages to disassembling: 1) while not hard to do, it’s still rather inconvenient, and 2) the disassembled output doesn’t give you the original comments and variable names, frustrating attempts to understand the code.

始终可以拆卸Unity .NET程序集,并且我们的服务条款明确允许这样做,以了解或改进您使用Unity进行的项目。 但是反汇编有两个明显的缺点:1)虽然不难做,但仍然很不方便; 2)反汇编的输出没有给您原始注释和变量名,这使理解代码的尝试受挫。

To address the convenience issue, a number of community members went out of their way and provided GitHub repositories with the disassembled code. Truth be told, we had mixed feelings about this. On one hand, we were happy to see our users organize a useful service to the wider Unity community, but on the other, their actions were, strictly speaking, not legal (while our terms permit disassembly, they do not permit redistribution, because that’s a legal can of worms).

为了解决便利性问题,许多社区成员不顾一切,为GitHub存储库提供了反汇编的代码。 说实话,我们对此有百感交集。 一方面,我们很高兴看到我们的用户为更广泛的Unity社区组织了一项有用的服务,但另一方面, 严格来讲 , 他们的行为是 不合法的(虽然我们的条款允许反汇编,但不允许 重新分发 ,因为那是合法的蠕虫罐头)。

There was only one good solution that’d address both issues: namely for us to publish the original source code ourselves.

只有一个好的解决方案可以解决这两个问题:即让我们自己发布原始源代码。

这不是什么 (What this is not)

In the interest of forestalling misunderstandings and clickbait, it’s worth taking a moment to emphasize what we’re not doing.

为了避免误解和点击诱饵,值得花点时间强调一下我们没有做的事情。

We are not releasing Unity as open source. Not even a little bit. (Sorry.) It’s not that we don’t like open source. We’d open source all of Unity today if we thought we could get away with it and still be in business tomorrow, and we do have a growing number of open source projects. But the main engine will remain proprietary for the foreseeable future, and the C# reference source code is released under a license which only permits you to read the code, not modify it. Please consult the full license text for details before you get carried away.

我们 不会 将Unity开源。 一点儿都没有。 (对不起)不是我们不喜欢开源。 如果我们认为我们可以摆脱它,并明天继续开展业务,那么我们今天将对所有Unity进行开源,并且我们 确实 有越来越多的 开源项目 。 但是主机在可预见的将来仍将是专有的,并且C#参考源代码是根据许可发布的,该许可仅允许您 阅读 代码,而不能对其进行修改。 在离开之前, 请查阅 完整的许可证文本 以获取详细信息。

We also do not take pull requests against the C# reference source code. We have neither the legal nor organizational frameworks in place to handle such PRs, not to mention that the mere act of preparing a PR is actually against the reference license (which, again, doesn’t permit modifications to the code). We would like to hear about it if you find a bug in the C# reference source code, but please report it using the Unity Bug Reporter (describing the issue and possibly linking to the relevant lines or files in the reference source code), not by submitting a pull request on GitHub.

我们也 不会 针对C#参考源代码 接受拉取请求 。 我们既没有处理此类PR的法律框架,也没有组织框架,更不用说仅仅准备PR的行为实际上是违反参考许可的(再次,它不允许修改代码)。 如果您在C#参考源代码中发现错误, 我们 希望 听到有关此消息的信息,但请使用Unity Bug Reporter(描述问题并可能链接到参考源代码中的相关行或文件)进行报告。在GitHub上提交拉取请求。

之后怎么样了? (What is it then?)

C# source of everything that goes into UnityEngine and UnityEditor managed assemblies, for every single version going back to Unity 2017.1. Going forward, the repository will be updated shortly after every new release.

C#源于UnityEngine和UnityEditor托管程序集的所有内容,可追溯到Unity 2017.1的每个版本。 展望未来,每个新版本发布后不久都会更新存储库。

By looking at each commit you can see what has changed between successive versions. For example, 2017.3.1 patch 2 changed these files:

通过查看每个提交,您可以看到连续版本之间的变化。 例如,2017.3.1补丁2更改了以下文件:

发布Unity C#源代码

That’s it! The reference source code repository is at https://github.com/Unity-Technologies/UnityCsReference, enjoy using it as reference for your Unity learning needs.

而已! 参考源代码存储库位于https://github.com/Unity-Technologies/UnityCsReference ,可以将其用作满足您Unity学习需求的参考。

翻译自: https://blogs.unity3d.com/2018/03/26/releasing-the-unity-c-source-code/