Пример #1
0
        public LifetimeScope CreateChildFromPrefab(LifetimeScope prefab, IInstaller installer = null)
        {
            if (prefab.gameObject.activeSelf && prefab.autoRun)
            {
                prefab.gameObject.SetActive(false);
            }

            var child = Instantiate(prefab, transform, false);

            if (installer != null)
            {
                child.extraInstallers.Add(installer);
            }
            child.parent = this;
            if (!child.gameObject.activeSelf)
            {
                child.gameObject.SetActive(true);
            }
            return(child);
        }
Пример #2
0
        public void Build()
        {
            if (runtimeParent == null)
            {
                runtimeParent = GetRuntimeParent();
            }

            if (runtimeParent != null)
            {
                Container = runtimeParent.Container.CreateScope(builder =>
                {
                    builder.ApplicationOrigin = this;
                    InstallTo(builder);
                });
            }
            else
            {
                InstallTo(new ContainerBuilder {
                    ApplicationOrigin = this
                });
            }

            DispatchPlayerLoopItems();
        }
Пример #3
0
 void IDisposable.Dispose()
 {
     LifetimeScope.RemoveExtra(key);
 }
Пример #4
0
 public ExtendScope(IInstaller installer, string key = "")
 {
     this.key = key;
     LifetimeScope.EnqueueExtra(installer, key);
 }
Пример #5
0
 public ParentOverrideScope(LifetimeScope nextParent) => overrideParent = nextParent;
Пример #6
0
 static void CancelAwake(LifetimeScope lifetimeScope)
 {
     WaitingList.Remove(lifetimeScope);
 }
Пример #7
0
 static void EnqueueAwake(LifetimeScope lifetimeScope)
 {
     WaitingList.Add(lifetimeScope);
 }