public void Awake() { Context = new UnityContext(gameObject); var managedTypes = GetType().Assembly.GetTypes() .Where(type => type.IsDefined(typeof(ManagedAttribute))) .ToDictionary(type => type, type => type.GetCustomAttribute <ManagedAttribute>()); foreach (var managedType in managedTypes) { // Key : type // Value : ManagedAttribute if (managedType.Value.ManagedType == ManagedType.Singleton) { Context.GetManaged(managedType.Key); } } }
public void CreateProtoManaged() { var protoManaged = _context.GetManaged <ProtoManaged>(); Assert.NotNull(protoManaged); }