Exemplo n.º 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);
        }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
 void IDisposable.Dispose()
 {
     LifetimeScope.RemoveExtra(key);
 }
Exemplo n.º 4
0
 public ExtendScope(IInstaller installer, string key = "")
 {
     this.key = key;
     LifetimeScope.EnqueueExtra(installer, key);
 }
Exemplo n.º 5
0
 public ParentOverrideScope(LifetimeScope nextParent) => overrideParent = nextParent;
Exemplo n.º 6
0
 static void CancelAwake(LifetimeScope lifetimeScope)
 {
     WaitingList.Remove(lifetimeScope);
 }
Exemplo n.º 7
0
 static void EnqueueAwake(LifetimeScope lifetimeScope)
 {
     WaitingList.Add(lifetimeScope);
 }