Unity is a Dependency Injection container developed by Microsoft.

learn more… | top users | synonyms

2
votes
2answers
84 views

Repository Pattern with Dapper + Unity

I just finished the Pluralsight courses about Inversion of Control and Mirco-ORMs, and I am struggling with the implementation aspect of some of the concepts. This is my (simplified) repository ...
2
votes
1answer
127 views

Tic Tac Toe (Decoupling patterns and component based design)

I'm learning unity with c# programming and trying to learn game design. I know the that the best way to learn games programming is recreate some of the existing games. This is my code to create Tic ...
3
votes
1answer
30 views

Hotkey detection for UI elements

I have several UI elements that can be opened using hotkeys for example the settings menu's key is Escape. The problem is that I have the Keycode stored in ...
2
votes
1answer
73 views

Moving a player around a board, by choice and by chance

Recently I had to add 2 different sets of logic for moving my player around the board. One lets the player pick a location and move him there while the other uses a dice. I'm reusing code for both ...
1
vote
1answer
78 views

Choosing/creating/setting an NPC dialogue - follow-up

Initial post: Sequentially displaying a list of game objects This file creates a dialogue box, sets the chat history box too inactive. It finds which NPC dialogue to display creates the list and sets ...
3
votes
1answer
94 views

Sequentially displaying a list of game objects

A chat background is created and a text[0] is displayed with a button created under it. The created button iterates thru text[] ...
6
votes
1answer
126 views

TCP authentication server and client

This is the first time I'm dealing with C# as I'm accustomed to Java sockets, so I do want your full review and anything you think I can accomplish better or optimize in the code will be very ...
1
vote
1answer
50 views

Changing height of an UI panel using Array content

I've created following code which works just fine: ...
3
votes
1answer
55 views

Wall-runner type game

I'm working on a Wall-runner reaction based game. As I know my way around a lot of the features Unity provides, I'm still in the beginner phase when it comes to working with several classes and ...
4
votes
3answers
388 views

Simple Q&A game

I just wanted to get some criticism on my programming to make me better. I made a game in Unity, just a simple question and answer game. Demo ...
1
vote
0answers
128 views

Identity repository pattern with UnitOfWork, GenericRepository and Unity

I created an application from 3 layers, DAL, BLL, and Representation layer in ASP.NET Web API. In DAL i have 4 Classes: - DatabaseContext.cs, UnitOfWork.cs, GenericRepository and UserInfo. In BLL i ...
2
votes
1answer
220 views

Repository Pattern universal application

When I started learning Repository Pattern with Unity few days ago I was under impression that the main benefit of this pattern is the separation of data layer from the business layer. In other words,...
3
votes
1answer
76 views

Unity Repository Best Practices

I am now developing a product, which will use Unity & Repositories when it comes to data management. I will demonstrate on a simple example. What we want to do, ...
1
vote
0answers
53 views

Unity post/get/check www requests with success callback and error callbacks

This is a class I built to handle post/get requests to URL's, but also check for connection and provide different callbacks depending on success or failure. It is intended to work without being ...
1
vote
3answers
179 views

Make C# Unity Script database methods more re-usable and concise

I have a C# file, that makes some modifications on screen (changes the text on the user interface) but I have some doubts: How I can re-use the below methods to be more concise and reusable? How I ...
4
votes
1answer
77 views

Method for obtaining adjacent chunk positions

I'm currently in the process of making a 2D tile based game. This game has an "infinite" world that can be traversed and modified as needed. I am creating the chunks with a mesh and I apply a texture ...
4
votes
1answer
1k views

Unit testing with dependency injection and MOQ

I'm just learning how dependency injection and mocking work, but I'd like some feedback on how I'm setting up a couple of tests. I can get them to pass, but I'm not sure this is all I need. This is ...
4
votes
3answers
409 views

Unity Lazy Resolve Implementation

I have been using Microsoft.Unity as my container and have decided that the approach for a lazy implementation causes too much rework. Each time you decide to swap ...
5
votes
1answer
3k views

EF Generic Repository + Unit of Work pattern with support for Async

I'm working on a generic repository using EF 6 code first and trying to following the Unit of Work pattern. Unity is being used to inject my repositories, and I'm trying to get everything supporting ...
3
votes
0answers
2k views

Unity Owin per request lifetime middleware

Having changed my website over to owin, I can no longer use Unity's PerRequestLifetimeManager. So I'm writing some middleware for owin in the style of Autofac's ...
5
votes
1answer
456 views

Unity and an IoC for Settings

After a somewhat lengthily discussion in the chat room, I have set up an IoC container with Unity to store my settings in. This is my static IoC class: ...