Unity is a Dependency Injection container developed by Microsoft.
1
vote
0answers
28 views
Caching using MS Unity Interception
I wanted to cache methods using unity interception and not have the parameters passed in stay alive for the sake of caching. If the objects would have gone out of scope without caching then the cache ...
1
vote
1answer
53 views
Object spawning script Unity
I´m trying to make a random object spawning script in Unity.
bellow is the code, any suggestions for improvement / changes?
i´m New to both Unity and c#.
...
1
vote
1answer
52 views
Unit test Web API controller that uses a static helper class which uses app config setting
I have a situation where I have a static class that reads my application configuration file for some configuration value. When unit testing Web API controllers that make use of this static class I am ...
3
votes
2answers
114 views
RPG character, levelUp system and stat checking for object usage
So I am working on a small RPG in Unity.
Right now I am writing some business classes, POCOs, that have no link to Unity except being in the required C# flavor and using Debug.Log and stuff.
I have ...
2
votes
2answers
149 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
150 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
48 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
79 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
79 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
97 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
240 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
58 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
410 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
177 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
324 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
97 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
65 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
210 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
84 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
2k 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
540 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
5k 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
496 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:
...