コード例 #1
0
 public PrefabSingletonProvider(
     DiContainer container, Type concreteType, PrefabSingletonLazyCreator creator)
 {
     _creator = creator;
     _container = container;
     _concreteType = concreteType;
 }
コード例 #2
0
 public PrefabSingletonProvider(
     DiContainer container, Type instanceType, PrefabSingletonLazyCreator creator)
 {
     _creator = creator;
     _container = container;
     _instanceType = instanceType;
 }
コード例 #3
0
 public PrefabSingletonProvider(
     DiContainer container, Type concreteType, PrefabSingletonLazyCreator creator)
 {
     _creator      = creator;
     _container    = container;
     _concreteType = concreteType;
 }
コード例 #4
0
        PrefabSingletonLazyCreator AddCreator(PrefabSingletonId id)
        {
            PrefabSingletonLazyCreator creator;

            if (!_creators.TryGetValue(id, out creator))
            {
                creator = new PrefabSingletonLazyCreator(_container, this, id);
                _creators.Add(id, creator);
            }

            return(creator);
        }
コード例 #5
0
        PrefabSingletonLazyCreator AddCreator(PrefabSingletonId id)
        {
            PrefabSingletonLazyCreator creator;

            if (!_creators.TryGetValue(id, out creator))
            {
                creator = new PrefabSingletonLazyCreator(_container, this, id);
                _creators.Add(id, creator);
            }

            return creator;
        }
コード例 #6
0
        public PrefabSingletonProvider(
            PrefabSingletonId prefabId, Type componentType,
            PrefabSingletonLazyCreator lazyCreator,
            SingletonRegistry singletonRegistry,
            PrefabSingletonProviderCreator owner)
        {
            _owner = owner;
            Assert.That(componentType.DerivesFromOrEqual <Component>());

            _singletonRegistry = singletonRegistry;
            _lazyCreator       = lazyCreator;
            _componentType     = componentType;
            _prefabId          = prefabId;
            _singletonId       = new SingletonId(componentType, prefabId.ConcreteIdentifier);

            Init();
        }
コード例 #7
0
        public PrefabSingletonProvider(
            PrefabSingletonId prefabId, Type componentType,
            PrefabSingletonLazyCreator lazyCreator,
            SingletonRegistry singletonRegistry,
            PrefabSingletonProviderCreator owner)
        {
            _owner = owner;
            Assert.That(componentType.DerivesFromOrEqual<Component>());

            _singletonRegistry = singletonRegistry;
            _lazyCreator = lazyCreator;
            _componentType = componentType;
            _prefabId = prefabId;
            _singletonId = new SingletonId(componentType, prefabId.ConcreteIdentifier);

            Init();
        }