Best DI for Unity in 2024?
Recently started a new pet-project, and searching for must-have libs. And I was struck by the reinventing the wheel disease again — decided to make a simple module for Dependency Injection. In general, it's not that there's much to do for basic things. The simplest bindings and
What I chose from:
1. Classic Zenject. But it's kind of dead. Even Extenject isn't in active development. But I've never liked Zenject's monstrosity. And after poking around in the code, I saw for myself that they've overdone it with reflection. Plus, it allocates a lot of unnecessary memory. What's interesting is that pools are even used for internal service tasks, which is pretty cool.
2. Reflex. Looks good, maintained. The code is generally much simpler than Zenject, there are still various contexts: Project -> scene -> other scenes.
3. VContainer won. Small, fast, and allocates less memory than others (according to the author). It seems to cover most of the cases. The code is simple, if necessary I'll fork it and modify it for myself. The only downside so far is that it can't resolve
What do you use currently for DI in Unity?
https://redd.it/1hm81u8
@r_Unity3D
Recently started a new pet-project, and searching for must-have libs. And I was struck by the reinventing the wheel disease again — decided to make a simple module for Dependency Injection. In general, it's not that there's much to do for basic things. The simplest bindings and
[Inject] attribute would have been enough. But then factories are added, prefab spawning, lazy initialization... As a result, after a couple of days, I decided to take 3d-party libs.What I chose from:
1. Classic Zenject. But it's kind of dead. Even Extenject isn't in active development. But I've never liked Zenject's monstrosity. And after poking around in the code, I saw for myself that they've overdone it with reflection. Plus, it allocates a lot of unnecessary memory. What's interesting is that pools are even used for internal service tasks, which is pretty cool.
2. Reflex. Looks good, maintained. The code is generally much simpler than Zenject, there are still various contexts: Project -> scene -> other scenes.
3. VContainer won. Small, fast, and allocates less memory than others (according to the author). It seems to cover most of the cases. The code is simple, if necessary I'll fork it and modify it for myself. The only downside so far is that it can't resolve
[Inject] on monobehs on the scene out of the box. You have to explicitly specify builder.RegisterComponentInHierarchy<Office>() for all of them. Off course, nothing prevents you from going through the scene and checking monobehs for the field.GetCustomAttributes attribute, but this will still be very slow for fat scenes with a bunch of nested objects. And it's cool that if you need to squeeze out performance, you can attach Roslyn Source Generator for sourcegen.What do you use currently for DI in Unity?
https://redd.it/1hm81u8
@r_Unity3D
GitHub
GitHub - modesttree/Zenject: Dependency Injection Framework for Unity3D
Dependency Injection Framework for Unity3D . Contribute to modesttree/Zenject development by creating an account on GitHub.
Unity suddenly started charging me $30 every month. Automatic subnoscription to Muse
https://redd.it/1hmfx55
@r_Unity3D
https://redd.it/1hmfx55
@r_Unity3D
problem with Buidling apk Unity 2D and Firestore Firebase as database.
hi! i am a newbie developing a 2D android online game. Im using Unity 2D and Firebase Firestore as database and i have trouble building an APK. i hope any well experienced developer can help me. you can hit me a dm, We can do Google meetings too. thanks!
https://redd.it/1hmihrj
@r_Unity3D
hi! i am a newbie developing a 2D android online game. Im using Unity 2D and Firebase Firestore as database and i have trouble building an APK. i hope any well experienced developer can help me. you can hit me a dm, We can do Google meetings too. thanks!
https://redd.it/1hmihrj
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
This media is not supported in your browser
VIEW IN TELEGRAM
I created some procedural shapes (shader) using Desmos and Unity as educational content.
https://redd.it/1hml6t2
@r_Unity3D
https://redd.it/1hml6t2
@r_Unity3D
Did some character designs for my game, which one do you like?
https://preview.redd.it/9c6js0sh469e1.png?width=1283&format=png&auto=webp&s=1db24607fcaf052b1b943410b808bf9a311f1f5a
https://redd.it/1hmlkd5
@r_Unity3D
https://preview.redd.it/9c6js0sh469e1.png?width=1283&format=png&auto=webp&s=1db24607fcaf052b1b943410b808bf9a311f1f5a
https://redd.it/1hmlkd5
@r_Unity3D
What 3D Assets do you feel are missing from the Marketplace that you would benefit from using?
Hey all! I've recently started working on 3D model packs for Unity, and I've seen that there's no shortage of really good cheap (or even free) things on the marketplace. I was curious what you feel is lacking and you'd like to see created (if at all). The most successful packs seem to be those huge ones with which you can create an entire game, stuff I don't really have the time to be doing as one guy. This is by no means an advertisement or anything, I'm just curious so I can focus on stuff people will actually use.
https://redd.it/1hml0gz
@r_Unity3D
Hey all! I've recently started working on 3D model packs for Unity, and I've seen that there's no shortage of really good cheap (or even free) things on the marketplace. I was curious what you feel is lacking and you'd like to see created (if at all). The most successful packs seem to be those huge ones with which you can create an entire game, stuff I don't really have the time to be doing as one guy. This is by no means an advertisement or anything, I'm just curious so I can focus on stuff people will actually use.
https://redd.it/1hml0gz
@r_Unity3D
Reddit
From the Unity3D community on Reddit
Explore this post and more from the Unity3D community
I made a small destruction system in Unity
Dear fellas, I know that I've never interacted here but today I have the pleasure to share with you a work I had been working for my final project in the University for the last year and a half, I present you...
My Unity destruction system!
Based in an old solution thread that uses NVIDIA Blast and a two community projects by ElasticSea and U3DC.
The solution continues to utilize NVIDIA Blast and Unity, but with a refined approach.
Instead of relying on Fixed Joints as in the previous solutions, this approach employs empty GameObjects to manually recreate physical connections from scratch using a graph structure, as well as to propagate received impacts. Subsets of chunks generated during this propagation are grouped under separate empty objects, with their physics applied individually.
Similar to the earlier solutions, fractures are generated in the Unity Editor. However, this version introduces a significant enhancement: NVIDIA Blast can now fracture GameObjects at runtime without performance issues. The fracture time varies depending on the complexity of the mesh.
Additionally, a new anchorage system dynamically determines whether the complete fracture is isKinematic or not, enabling the representation of both static and dynamic objects. This system also defines the physics for each generated subset.
The character and weapon systems, both implemented by me, are seamlessly built on top of the fracture system described above.
And this is the general overview and the final point of this phase, I don't know if I will continue with this or I'll leave it as it is, because I've been working a long year and a half with it and I need a break of it.
Showcase of the destruction system
https://redd.it/1hmn5ih
@r_Unity3D
Dear fellas, I know that I've never interacted here but today I have the pleasure to share with you a work I had been working for my final project in the University for the last year and a half, I present you...
My Unity destruction system!
Based in an old solution thread that uses NVIDIA Blast and a two community projects by ElasticSea and U3DC.
The solution continues to utilize NVIDIA Blast and Unity, but with a refined approach.
Instead of relying on Fixed Joints as in the previous solutions, this approach employs empty GameObjects to manually recreate physical connections from scratch using a graph structure, as well as to propagate received impacts. Subsets of chunks generated during this propagation are grouped under separate empty objects, with their physics applied individually.
Similar to the earlier solutions, fractures are generated in the Unity Editor. However, this version introduces a significant enhancement: NVIDIA Blast can now fracture GameObjects at runtime without performance issues. The fracture time varies depending on the complexity of the mesh.
Additionally, a new anchorage system dynamically determines whether the complete fracture is isKinematic or not, enabling the representation of both static and dynamic objects. This system also defines the physics for each generated subset.
The character and weapon systems, both implemented by me, are seamlessly built on top of the fracture system described above.
And this is the general overview and the final point of this phase, I don't know if I will continue with this or I'll leave it as it is, because I've been working a long year and a half with it and I need a break of it.
Showcase of the destruction system
https://redd.it/1hmn5ih
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
I think my Free toolkit has potential (Put on your headphones) - Multiversal Vehicle Controller - Asset Store
https://redd.it/1hmng9s
@r_Unity3D
https://redd.it/1hmng9s
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
I created a system in my game Dead Engine where we can expand our bag and add items. What do you think of it?
https://redd.it/1hmpvcj
@r_Unity3D
https://redd.it/1hmpvcj
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
I would like to present to you a project that my colleague and I have been working on for the past three years.
Status One will be available on Steam on January 10th. If any of you would like to test the Demo, it will be available until the end of this year.
https://redd.it/1hmp4eu
@r_Unity3D
Status One will be available on Steam on January 10th. If any of you would like to test the Demo, it will be available until the end of this year.
https://redd.it/1hmp4eu
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
There are only a few days left until the New Year, and in my game, the Christmas cocktails and special menu are ready, along with the festive decorations. Have I covered everything for the comfort of the guests?
https://redd.it/1hmuzw4
@r_Unity3D
https://redd.it/1hmuzw4
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
Big arm mode! One of those rare moments where simply scaling up an object came through.
https://redd.it/1hmvwo0
@r_Unity3D
https://redd.it/1hmvwo0
@r_Unity3D
Best approach to have common UI for all levels?
Hello fellow game devs,
I am building a 2D game, where after the main menu, you start at level 1 (which is a separate scene), and each when you destroy all enemies you move to level 2 (scene 2) and so on..
I want to add a Label with the score that increases everytime you kill and enemy and stays across all leven scenes.
What is the best approach to do this? Should I have a prefab for the score UI and add it to all scenes manually or via noscript? Or is there a better approach?
(Note: I might end up having like 30 levels)
https://redd.it/1hmy5xz
@r_Unity3D
Hello fellow game devs,
I am building a 2D game, where after the main menu, you start at level 1 (which is a separate scene), and each when you destroy all enemies you move to level 2 (scene 2) and so on..
I want to add a Label with the score that increases everytime you kill and enemy and stays across all leven scenes.
What is the best approach to do this? Should I have a prefab for the score UI and add it to all scenes manually or via noscript? Or is there a better approach?
(Note: I might end up having like 30 levels)
https://redd.it/1hmy5xz
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Applications from different categories in the same account
Would it be a problem if I published a PDF viewer, a shooter game, and a strategy game at the same account? (Google and Apple Developer accounts)
Does it prevent any apps from being featured?
https://redd.it/1hmz6vu
@r_Unity3D
Would it be a problem if I published a PDF viewer, a shooter game, and a strategy game at the same account? (Google and Apple Developer accounts)
Does it prevent any apps from being featured?
https://redd.it/1hmz6vu
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Does DOTween have better or equal performance as Unity animator?
I am currently using DOTween for literally all UI animations and so I want to know whether this will affect my game performance wise.
https://redd.it/1hn8nbl
@r_Unity3D
I am currently using DOTween for literally all UI animations and so I want to know whether this will affect my game performance wise.
https://redd.it/1hn8nbl
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Get confused by object layer
I’m having a problem that I have a player object with sorting layer “Player” and another table object with sorting layer “Intractable” which is higher than the player, each of them has box collider at the bottom half so the object can get closer.
Now the problem is: when my player is behind the table it looks correct, the table covers bottom half of my player’s body, but if my player is in front of the table, the table seems still on top of the player which covers the players head.
I’m not sure what’s go wrong…
https://redd.it/1hn9l6d
@r_Unity3D
I’m having a problem that I have a player object with sorting layer “Player” and another table object with sorting layer “Intractable” which is higher than the player, each of them has box collider at the bottom half so the object can get closer.
Now the problem is: when my player is behind the table it looks correct, the table covers bottom half of my player’s body, but if my player is in front of the table, the table seems still on top of the player which covers the players head.
I’m not sure what’s go wrong…
https://redd.it/1hn9l6d
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community