real-serious-games / factory Goto Github PK
View Code? Open in Web Editor NEWFactory for object creation and dependency injection. Works with normal C# apps or under Unity3d
License: MIT License
Factory for object creation and dependency injection. Works with normal C# apps or under Unity3d
License: MIT License
Hi!
As explained here:
https://docs.unity3d.com/Manual/ScriptingRestrictions.html
The AOT compiler does not support System.Reflection.Emit namespace.
Is it possible to make Factory work for IL2CPP too?
Sometimes we want to create a class without an interface so that its dependencies can be resolved. Currently there are a few ways to do this but none is ideal:
// Factory.Create(Type) returns object, so needs to be casted to the correct type
var newObj = (SomeObject)Factory.Create(typeof(SomeObject));
// We can also use the string name, but this can cause issues with refactoring later
// This is less of an issue in C#6 because of 'nameof', but that isn't available in C# 4
var newObj = Factory.Create<SomeObject>("SomeObject");
// Creating from interface works with no arguments, but means we need to implement
// an interface
var newObj = Factory.CreateInterface<ISomeObject>();
In theory, this would work and be nicer to write, but does not exist in the current version of the library:
var newObj = Factory.Create<SomeObject>();
Working out stuff for releasing my project that uses this library and I realised it doesn't specify a license anywhere! I'm assuming MIT would be most appropriate because that's what the rest of RSG's open source code uses?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.