Questions tagged [dependency-injection]
The dependency-injection tag has no summary.
16 questions
0
votes
1
answer
241
views
A good way of handling MonoBehaviour initialization in Unity?
Recently, I've been experimenting with different ways of initializing MonoBehaviours (since constructors are not an option), and I reached a solution that I am mostly satisfied with, but there are a ...
1
vote
1
answer
2k
views
Zenject: Inject into monobehavior
I want to start using zenject in my project but I encountered an issue.
From their tutorial in github page I was able to inject non monobehavior objects into each other like this.
...
-3
votes
1
answer
482
views
How can I execute a C# script even if my game is closed?
I've made a game with Unity and I want to execute a C# script that runs even the game was closed.
I searched a lot but didn't find anything.
3
votes
1
answer
1k
views
Should I use dependency injection in Unity? [closed]
As learned about dependency injection on the internet, I found that it's something that can be done simply by the Singleton Pattern.
But there are 2 completely different views on this issue:
Some ...
4
votes
1
answer
558
views
When should I acquire game objects with dependency injection, find-with-tag, or singletons?
This is sort of a best practice/efficiency kind of question, and I haven't really seen any other question talking about these three things together.
Essentially, Dependency Injection, Find with Tag (...
1
vote
1
answer
1k
views
How to assign game object references to a class instance created at runtime?
I'm creating a game where I have an Entity class that contains basic entity info (pos, health,..) and some functions. Enemies and Player later on inherit from this class.
...
0
votes
1
answer
1k
views
Client Server Multiplayer Project
I have reviewed the relevant WinForms/XNA samples here and here.
However, my requirements are slightly different.
Given the following:
I am developing a multiplayer (Client - Server) game
There will ...
4
votes
1
answer
303
views
Using Ninject for DependencyInjection on Xbox, noticable impact?
This may be classed as a slightly subjective question but there is very little information on this at the moment, so I just thought I would ask here incase anyone has any experience with this.
I am ...