private void BindPrefabToContainer(InstallAttribute attr, Object prefab) { var binding = Container.Bind(attr.InstallType); switch (attr.InstallMethod) { case InstallMethod.Single: binding.FromComponentInNewPrefab(prefab).AsCached(); break; case InstallMethod.Transient: binding.FromComponentInNewPrefab(prefab).AsTransient(); break; case InstallMethod.WithId: binding.WithId(attr.Id).FromComponentInNewPrefab(prefab).AsCached(); break; } }
private void BindTypeToContainer(InstallAttribute attr, System.Type type) { var binding = Container.Bind(attr.InstallType); switch (attr.InstallMethod) { case InstallMethod.Single: binding.To(type).FromNew().AsCached(); break; case InstallMethod.Transient: binding.To(type).FromNew().AsTransient(); break; case InstallMethod.WithId: binding.WithId(attr.Id).To(type).FromNew().AsCached(); break; } }