#Unity apis

1 messages · Page 1 of 1 (latest)

hidden dew
#

Have there been any projects to standardize the unity API to more closely match .NET standards? Many of the APIs like mechanim don't really follow most adopted standards.

past coyote
#

What kind of standards are you talking about? Can you provide an example?

silver pelican
# hidden dew Have there been any projects to standardize the unity API to more closely match ...

Are you aware of how old some of these systems are?
Im also curious what standards you're talking about, but in reality game development is different from enterprise projects. A vast majority of people here don't code things the same way you might be used to. The people we've seen try to follow "modern standards" often just have to fight against the system and do things in awkward ways

hidden dew
#

Thanks for taking the time to answer. I don't mean to push any kind of programming paradigm upon unity, I understand the differences between what I do professionally and what most are used to in Unity. My biggest help has been using UniTask which has been a gamechanger as far following conventions. The standards I'm referring to are the .NET Coding conventions and what most Nuget packages follow: https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions

Unity on the other hand does things quite differently, which is not a problem but more of a thing that slows you down cause it seems you have to learn each API differently as they don't often follow the same conventions.

past coyote
#

Though I don't really touch C# much outside of gamedev, so might be missing something more obvious.

hidden dew
#

Animation Events is a pretty big one

#

LineRenderer as well

silver pelican
# hidden dew LineRenderer as well

im not sure what you're referring to with LineRenderer because it seems pretty similar to the other components in terms of convention.
a lot of things need to work in the editor. Not everyone working on a game is a developer, so you need anyone to be able to setup features. Animation events using magic strings to call a function is pretty much required given if you want it assignable in inspector

past coyote
#

The fact that you just provided these types without any explanation, makes me think that we might not be on the same page at all.

hidden dew
#

thanks for trying to help but I think if you don't know of any projects that standardize the API, then that's okay.

past coyote
#

I mean, it would just be nice to hear a proper explanation of what you mean. Perhaps we do know the answer, but since we don't entirely understand the question,we can't provide it.

sacred sparrow
# hidden dew Have there been any projects to standardize the unity API to more closely match ...

Not really, all that stuff is hard coded in the core engine or buried in their Unity-controlled packages. Things like the line renderer are also ancient, break sometimes between unity versions, and are just kind of on bare life support.

Unity is a bit funny with its consistency, they don't like to follow Microsofts c# standards in general. Even their examples often mix up things like camel case between help pages and sometimes in the same code.

You'll get used to it though.

Also, some C# standards are also a bit weird to use to Unity (some things like autoproperties are borderline pointless for example in 99% of cases)

#

There is also a reason behind a lot of it (i.e. linerenderer goes back to when UnityScript was still popular and needed to match format styles as best they could between languages) it's just a lot of explaining that doesn't really help anything

plain warren
#

New packages tend to use standard naming conventions at least; but that's not the case with the engine itself, and there's not enough justification to change that.

sacred sparrow
#

One thing unity has done well (maybe to a fault sometimes) is maintaining as little breaking changes as possible. But as someone maintaining 12+ year old projects sometimes, I'm every thankful for that in a way.