MonoBehaviourSingletonLazyCreator AddCreator(MonoBehaviourSingletonId id) { MonoBehaviourSingletonLazyCreator creator; if (!_creators.TryGetValue(id, out creator)) { creator = new MonoBehaviourSingletonLazyCreator(_container, this, id); _creators.Add(id, creator); } return(creator); }
MonoBehaviourSingletonLazyCreator AddCreator(MonoBehaviourSingletonId id) { MonoBehaviourSingletonLazyCreator creator; if (!_creators.TryGetValue(id, out creator)) { creator = new MonoBehaviourSingletonLazyCreator(_container, this, id); _creators.Add(id, creator); } return creator; }
public MonoBehaviourSingletonProvider( MonoBehaviourSingletonId monoBehaviourId, Type componentType, MonoBehaviourSingletonLazyCreator lazyCreator, SingletonRegistry singletonRegistry, MonoBehaviourSingletonProviderCreator owner) { _owner = owner; Assert.That(componentType.DerivesFromOrEqual <Component>()); _singletonRegistry = singletonRegistry; _lazyCreator = lazyCreator; _componentType = componentType; _monoBehaviourId = monoBehaviourId; _singletonId = new SingletonId(componentType, monoBehaviourId.ConcreteIdentifier); Init(); }
public MonoBehaviourSingletonProvider( MonoBehaviourSingletonId monoBehaviourId, Type componentType, MonoBehaviourSingletonLazyCreator lazyCreator, SingletonRegistry singletonRegistry, MonoBehaviourSingletonProviderCreator owner) { _owner = owner; Assert.That(componentType.DerivesFromOrEqual<Component>()); _singletonRegistry = singletonRegistry; _lazyCreator = lazyCreator; _componentType = componentType; _monoBehaviourId = monoBehaviourId; _singletonId = new SingletonId(componentType, monoBehaviourId.ConcreteIdentifier); Init(); }