The C# part of the Unity engine and editor source code. https://github.com/Unity-Technologies/UnityCsReference https://twitter.com/CiroContns/status/977682857907949568
This is stupid. What's the point of it, if "The terms of use do not permit you to modify or redistribute the C# code (in either source or binary form). If you want to modify Unity's source code (C# and C++), contact Unity sales for a commercial source code license: " And at the top says " May be used for reference purposes only.". So what's the point of them even showing any of them when you can't even be allowed to change something for your self.
@N1warhead: I'm inclined to believe they're doing it because nothing was stopping people from doing it before when hunting down bugs though it could just be one step towards releasing the engine's source code down the road.
Probably because pretty much every programmer who gets in depth with Unity starts poking around in the C# source eventually. Its pretty much part and parcel of doing the job. Its difficult for Unity to prevent this from a technical or legal standpoint. Since everyone is doing it anyway, that might as well sanction it and make it easy to do.
It's very useful for seeing how they do certain things, like even relatively simple stuff like vector transformations and such. And much of that kind of thing is already public domain as far as the algorithms/math involved, with implementations being almost identical regardless of where the code came from. So there is just really no reason to hide it.
Honestly, I ain't never once tried to de-compile the Unity stuff and look at it. Never had a purpose too, don't generally run into many bugs though honestly. It's quite rare for me. Or perhaps the bugs that happen I didn't realize were bugs because they gave me the results I wanted hahha.
I just think its a nice base to understand what Unity is doing and copy some editor functionality if I need it.
I used it just recently when I needed to duplicate some logic that was in non thread safe api's for jobs, and wanted to make sure I was using the same logic.
I probably will yeah, I'm sure Unity isn't gonna kick my ass for making internal Unity editor tools using Unity source. If they have to, they should tinker with the license until they don't
The question of can you use it depends. They aren't licensing what the code does in many cases, because they can't, it's already in the public domain. Doesn't matter that you might have learned about it from their code. You can't just copy it blatantly, but even then if there is really only one obvious way to implement it and that is what they did, then your implementation is probably gong to look the same. And all told I agree with @hippocoder, if you make use of it in the context of Unity, I doubt they will care. I doubt anything in that repo implements any approach not in the public domain already anyways so why would they.
I mean I get that, but still doesn't mean it has a point if you can't do anything with it. Like, for example, I see something in it I like, and want to make my own Method out of something in it, I can or can't do that? if not, it's just one more thing you guys have to manage that will slow progress down on other things if you guys make a lot of changes too the C# Source Code. Now if I can copy code from it and put it into something I'm making, then that's awesome. But it doesn't clearly state this as @hippocoder said.
its just nice to have for reference, and in the past i did have cases where i had to look through the C# source, and make calls to some private or internal methods via reflection to accomplish what i needed. Also has helped me a lot understand the performance implications of calling certain unity methods
I mean, I see nothing wrong with using the code, and that's awesome if we can. But last thing I want is a 10 million dollar law suit hitting me because I had 1 line of code from it somewhere lol.
Yeah I think the point is pretty clear, to help Unity users do stuff with a reference, Unity really isn't going for people like you or me, we are the intended audience of this. Perhaps they need more lawyer time, I'll not worry.
If you read the code, and what you read helps you understand how to do something, and you implement your own stuff that makes use of that understanding, then that's fine.
The thing I would most like to see is the Mesh classes which I suppose is C++ Pretty cool that the C# got released, I'll have to poke through it.
The source reference should be useful for serious coding. Thanks for that. will us get paid for helping the debug?
No, but if you want to make money doing say asset store stuff and copy the code outright, well you'd need a different license for that. Unity blogpost on the matter. https://blogs.unity3d.com/2018/03/26/releasing-the-unity-c-source-code/
Not related to asset store, however Unity users are reporting issues more than developing their own games since 5.x, and this is also affecting vendors in asset store, keeping them busy on apply patches for different Unity versions. Since there are a lot of experienced users in the community, those may loyalty since Unity2.x. I would guess the commercial source code license is kind of bounty hunter recruitment for relieving the QA progress.
For the most part source licenses are for developers who need the absolute best performance or need to support a use case that would otherwise be passed over by a company that is focused on developing a general purpose engine. Large companies are well known for this. Skyrim's Creation Engine, for example, is a heavily modified GameBryo.
Oops, I thought the commercial source code license is kind of being Moderator and different from the source code access licence from Pro/Enterprise.
Just a matter of fact, there was an unnoficial repo that does the same thing. It was there for three years before taken down by Unity a month ago. It surprises many people, even on reddit. I saw couple of good points of why it was popular and had raised more than a thousand stars in GitHub. ... then the official repo came out, which made everything makes sense.
I have been to it multi times in the past.. sometimes from search engine in looking up a method to find some better documentation.. cus yknow official docs blow in comparison to api references with crowd source comments like php help docs etc.. way more useful.....still hadn't been unofficial github page in a while so never saw that it was taken down since last month... it makes the unity blog about them doing this as less yknow whats the word?. Because that action strikes me as stupid they would take down the existing third party managed github project when they hadn't even got there official one up for a month? did no one think to delay the email to legal team dawgs for a month or when they got the official github counter part up ? .. ..I'm guessing clearly not as they had a penny drop moment days or weeks after the project was shutdown at how stupid it was when nothing about the c# source is that protected.
With how long they permitted it it's obvious Unity didn't care that it existed. They just issued the takedown because they wanted to provide it themselves and not have people going to one that was a reverse engineer instead of a true copy.
Only the unofficial one was shutdown a month ago.. I didn't notice.. but this official one was only announced today.. so timing was all off on that even if they were planning an official one.. They let the legal dogs out the cage ..on a takedown for something that didn't have a replacement yet.. did MattRx get a thank you letter, along with that takedown notice?
A better way to do it, is publish the official repo, and politely ask the unofficial repo to redirect them without taken down. With the official repo, people has no reason to continue on the unofficial one. Not only the efficient way to spread the news for existing repo user, but also gaining Likes from them for such customer care.
Sadly there is no definition for "polite" in terms of dealing with lawyers. It was taken down because it's "violates" the "do not distribute decompiled code" part. It's kinda sad that there always someone that makes creativity harder and complicated just because the law told them to do so. But hey, atleast Unity heard us. Now we have a very cool way to bringing attention for Unity to fix their bugs that stick for a looong time, like this one.
Polite was allowing it to exist in the first place when it was clearly breaking the license agreement they would have signed.
When a company already has an absolute rights, they could reserve it. Corporations law is used to prevent from losing profits, but in a wrong way could help them losing more. Today smart company has their corporate lawyer to learn PR, and a win-win result can gain positive reputation with increase of sales as well.
But you can do something with it. For one instance, have you ever looked in the docs and found something ambiguous, unclear, or just plain missing? With this, instead of guessing or testing how it works for yourself, you can look at the code and see.
Which is where you find out that all the call does is pass an identical call into the C++ side of the engine, and you are stuck again.
This is a nice move. Unity has a C++ core, a C# scripting Engine and a few other tools that work to together to produce the final result, which varies by platform. The code that is released has little to do with performance - the C++ core is the main determining factor. The caching method ArenMook contributed in pull requests section is an exception to the above statement. It does however provide most of the so far undocumented parts of Unity Editor methods - it is useful for people developing Editor Tools as a reference.
I do wonder at the lack of optimisation in places, although perhaps it can be explained how this is compiled out: Mathf: public static float Abs(float f) { return (float)Math.Abs(f); } I know most maths calls are just calls into the c̶+̶+̶ C# maths library but Abs is so simple this will waste a load of cycles going into the c̶+̶+̶ C# [double] function only to return "f > 0 ? f : -f" edited for not being awake
Math.Abs is part of the C# System namespace, so all it's doing is handling the casting from double to float for you, there's no C++ bridging happening. Chances are the compiler will automatically optimize the extra function call away for an actual build.
Unity finally releases source code. The source code: Code (CSharp): public void Invoke(string methodName, float time) { InvokeDelayed(this, methodName, time, 0.0f); } [FreeFunction] extern static void InvokeDelayed(MonoBehaviour self, string methodName, float time, float repeatRate);
Is the available source code complete? I'm looking for the RenderTexture source, more specifically ConvertToEquirect(), but it's not there. Some sources references [NativeHeader("Runtime/Graphics/RenderTexture.h")] but there's no Runtime/Graphics folder.
No. Like the Github repo mentions this is just the C# side of the engine. The C++ side is still very much closed source.
I cannot tell you how many times being able to see into the Unity source code has simplified the things I have developed for Trilleon. It has saved me hours of work. Now, being able to modify it could, in very limited circumstances, be quite nice. I would love to be able to modify and enhance the EditorWindow system to make more visually appealing and reactive content in those - and then offer the new framework for it freely. But I definitely don't expect write access to anything Unity creates. I do expect read access to some of their code - but only because they present Unity as uniquely developer friendly. And I appreciate that.
Just keep in mind the license hasn't changed. You're not actually allowed to modify it without a source license as mentioned in the readme for the repository. It's literally just a way to reference the source without having to use a decompiler. I'd love to eventually see that limitation go away.
ive needed to reference the source quite a few times in the past, there is some things that was barely documented in the docs