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