Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [dependency-injection]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers

Resolve dependency between two installers in Zenject

Im trying to implemet dependency injection in my Unity project by using Zenject. I have two installers. The first one is Monoinstaller who is responsible for injection and creation of scene objects, ...
Ilya's user avatar
  • 11
0 votes
2 answers

Modeling a naturally circular relationship between three classes

I have three classes Location, Item, Character. Every ...
Michael Moreno's user avatar
1 vote
1 answer

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. ...
Taras Fityo's user avatar
2 votes
1 answer

Pass data down to components

In the game I have, I'm using an architecture close to what I've seen of Unity components : Basically, the universe implements the game loop, entities implement and ...
user avatar
-3 votes
1 answer

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.
Oussama Sabri's user avatar
1 vote
0 answers

Zenject injection from an existing in scene prefab

I am trying to use Zenject to automatically inject a reference to a component on a game object that I have in the scene, but can only seem to make the create new component on new object work. Should I ...
Doug Ray's user avatar
  • 143
3 votes
1 answer

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 ...
virtouso's user avatar
  • 2,628
1 vote
0 answers

unity game engine - should I be using a di framework / ioc container [closed]

Is it worthwhile for a solo dev to take up the widely recommended practice of using a dependency injection framework within the unity game engine? I have seen reason for concern regarding the clash of ...
eternalNoob's user avatar
4 votes
1 answer

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 (...
rachica's user avatar
  • 43
0 votes
1 answer

Adding network support

I am trying to implement a simple game "Bulls and cows" in c#. It is a final project of my university course about design patterns. The target of the game is simple - try to guess the opponent number. ...
snoward's user avatar
1 vote
1 answer

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. ...
MSKL's user avatar
  • 133
8 votes
2 answers

Inversion of control in Unity?

I am semi-experienced .NET developer who has just began working with Unity. I am trying to decide on how to make IoC work in Unity 4.X ( I have not yet tested anything), and I wonder what are the good ...
actionjezus6's user avatar
0 votes
1 answer

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 ...
George's user avatar
  • 127
4 votes
3 answers

Getting Started with Component Architecture: DI?

TLDR: if I have entities like Ship and Bullet and components like Positionable and ...
ashes999's user avatar
  • 11.3k
4 votes
1 answer

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 ...
Grofit's user avatar
  • 383
34 votes
8 answers

Do retail games use "inversion of control" and "dependency injection"?

Many of the more diligent software developers I know are moving to inversion of control and dependency injection to handle references to objects. Coming from a Flash games perspective I don't know all ...
Iain's user avatar
  • 6,528