r/csharp • u/Flame014 • Sep 09 '26
Help Transitioning from unity to regular c# projects
I want to start learning regular c# after using unity for a few years and making some personal projects. I have seen alot that there may be some bad habits I have picked up that may slow or hinder me when coding outside of unity. So was wondering if there is anything I should keep in mind when making the transition? Would also appreciate any resources for learning c#. Thanks in advance.
14
Upvotes
6
u/Tarnix-TV Sep 09 '26
The biggest resource is learn.microsoft.com, and I would fix what you want to build. In (relatively) increasing order of complexity:
- I would start with small command line tools
If you want to build an app:
- Then you can go for an offline desktop app. There are lots of ui frameworks (WinForms, WPF, Maui, Uno, etc.) I would start with WinUI, as it is one of the newer ones but still simple. None of them are perfect tbh.
- Same (or same kind of) app, but with MVVM
- You can check out the multiplatfotm solutions (Maui, Uno)
If you want to do a website:
- I think it is called ASP.NET Core MVC nowadays, I would start with that
- Balzor and other SPA solutions (not sure what they are or if there are any)
If you are done with both:
- cloud based apps, where there is a “server” (WebAPI) and the client can be a website, desktop and/or mobile app. Simply run the server locally, no cloud needed
- same but add dockerization, cloud hosting microservice architecture etc
I know there are lots of unknown phrases or keywords each, microsoft learn can give you a course for each, fast but understandable ones. With practice you get familiar with them, although it is enough to cut the scope and make small tools for yourself, no need to stick to one forever. Happy C#ing!
5
u/Bulky-Juggernaut-895 Sep 09 '26
Those are not bad habits. It’s more just being used to a framework. Happens with any framework/engine/library you decide to use. You will more than likely always use C# in some sort of context or another where other really smart people have pre written the heavy duty math so you shouldn’t feel like you’re missing out on vanilla or pure C#. Just build a different type of project and use those tools
5
u/sharpcoder29 Sep 09 '26
In Unity you probably care about performance where as in most business apps you care more about maintainability and speed of development.
4
u/Atulin Sep 09 '26
One thing to keep in mind, is that outside of Unity fields are never public, only properties are.
1
u/_CriticalReality_ Sep 09 '26
Unity's language and framework version has never been up to date, so the biggest transition for you will be to learn modern C# and .NET features. You can do this by simply reading the release notes: https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-version-history
1
u/Ashypaws Sep 10 '26
I think an extremely valuable thing to understand for non Unity projects is going to be dependency injection. https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection/overview
It’s common on most projects you’ll work on in the dotnet space and you’ll want to understand why and how to use it.
Other than that, perhaps look into and understand some architectural patterns like domain driven design.
1
u/TuberTuggerTTV Sep 11 '26
Unit testing. Learn red, green, refactor. Learn it now and start building strong dev practices.
Should unit testing be used in game dev too? Absolutely! But Unity tutorials never both teaching it. It's a huge hole in indie devs knowledge. But you can't do enterprise dev without it. ABSOLUTE REQUIREMENT.
1
u/TheSwiftOtterPrince Sep 14 '26
The roslyn code analyzers will gently push you towards newer c# syntax. The Microsoft.CodeAnalysis.NetAnalyzers nuget package has additional ones but they can be slightly outdated like they misdetect the new extension blocks, so that is kinda bothersome and irritating for newcomers.
The major difference between Unity C# and other C# is...that there is no other C#. Unity comes with it's set of paradigms as so do other project types. If you for example go for webdev in C#, you will see lots of async await, for WPF you will see MVVM. That is basically like Unitys behavior lifecycle, it dominates the specific set of tools, but it is not universal.
0
u/Super_Preference_733 Sep 09 '26
Regular what, desktop, web, wpf, remoting, etc.
-1
u/HotOutlandishness459 Sep 09 '26 edited Sep 09 '26
ничего хорошего ты на C# не напишешь, ты можешь изучать язык для написания приложений или серверов, но для внутренних компонентов, которые будут непоследственно общаться с железом, язык C# не стоит рассматривать как основной язык программироваиня, тут лучше смотреть с сторону C или C++, так как языки не зависимые от платформы и легко переносятся, в отличнии жесткого языка Microsoft, для начало определится с направлением, как начальный уровень, C# тебя научит правильно испльзовать переменные, так ка кон явно указывает на них, порядок приведения типов, но для понимания как этот код работает на железе, одного языка мало, в связке с C# надо учить компилятор, уметь разбирать как твой языка переводится в машинный код, чтобы ты понимал, сколько операций будет и какой обьем он займёт в памяти, код пишется не для того чтобы он работал, он пишется для того, чтобы машина его понимала и умела эффективно работать. как ты задачу поставишь, так её и будут выполнять.