public void Install() { DataNetFactory dataNetFactory = new DataNetFactoryDummy(); DataNet netToAdd = dataNetFactory.Create(new DataNetFactory.Parameter(Guid.NewGuid(), _netToAddName)); DataNet netInContainer = dataNetFactory.Create(new DataNetFactory.Parameter(Guid.NewGuid(), _netInContainerName)); DataNetContainerImpl container = new DataNetContainerImpl(); container.Add(netInContainer); Container.Bind <DataNetContainer>().WithId("Empty").To <DataNetContainerImpl>().AsTransient(); Container.Bind <DataNetContainer>().WithId("WithElement").To <DataNetContainerImpl>().FromInstance(container).AsTransient(); Container.Bind <DataNet>().WithId("NewNet").FromInstance(netToAdd).AsTransient(); Container.Bind <DataNet>().WithId("ExistingNet").FromInstance(netInContainer).AsTransient(); Container.Inject(this); }
public void Install() { PreInstall(); //Setup scene UITestPrefabPaths paths = new DataNetUITestPrefabPaths(); Container.Bind <UITestCanvas>().FromComponentInNewPrefabResource(paths.HightMatchingCanvasPath).AsSingle().NonLazy(); Container.Bind <Camera>().FromComponentInNewPrefabResource(paths.TestCameraPath).AsSingle().NonLazy(); //Bindings Container.Bind <SelectedDataNet>().AsSingle(); Container.Bind(typeof(NetSelectionElementInstaller), typeof(SelectNetOnClick), typeof(NetNameDisplay), typeof(SceneLoaderOnClick), typeof(SceneUnloaderOnClick)).FromComponentInNewPrefabResource(ResourcePaths.NetSelectionElementPrefabPath).AsSingle().NonLazy(); DataNetFactory factory = new DataNetFactoryDummy(); Container.Bind <DataNet>().FromInstance(factory.Create(new DataNetFactory.Parameter(_netName))).AsSingle(); PostInstall(); //Init Objects _element.transform.SetParent(_canvas.Hook, false); }