コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        public void CreateProtoManaged()
        {
            var protoManaged = _context.GetManaged <ProtoManaged>();

            Assert.NotNull(protoManaged);
        }