public void Construct(NoteAssetLoader _noteAssetLoader, DiContainer Container, GameplayCoreSceneSetupData sceneSetupData) { CanSetup = !(sceneSetupData.gameplayModifiers.ghostNotes || sceneSetupData.gameplayModifiers.disappearingArrows) || !Container.HasBinding <MultiplayerLevelSceneSetupData>(); if (_noteAssetLoader.SelectedNote != 0) { var note = _noteAssetLoader.CustomNoteObjects[_noteAssetLoader.SelectedNote]; MaterialSwapper.GetMaterials(); MaterialSwapper.ReplaceMaterialsForGameObject(note.NoteLeft); MaterialSwapper.ReplaceMaterialsForGameObject(note.NoteRight); MaterialSwapper.ReplaceMaterialsForGameObject(note.NoteDotLeft); MaterialSwapper.ReplaceMaterialsForGameObject(note.NoteDotRight); Utils.AddMaterialPropertyBlockController(note.NoteLeft); Utils.AddMaterialPropertyBlockController(note.NoteRight); Utils.AddMaterialPropertyBlockController(note.NoteDotLeft); Utils.AddMaterialPropertyBlockController(note.NoteDotRight); Container.BindMemoryPool <SiraPrefabContainer, SiraPrefabContainer.Pool>().WithId("cn.left.arrow").WithInitialSize(25).FromComponentInNewPrefab(NotePrefabContainer(note.NoteLeft)); Container.BindMemoryPool <SiraPrefabContainer, SiraPrefabContainer.Pool>().WithId("cn.right.arrow").WithInitialSize(25).FromComponentInNewPrefab(NotePrefabContainer(note.NoteRight)); if (note.NoteDotLeft != null) { Container.BindMemoryPool <SiraPrefabContainer, SiraPrefabContainer.Pool>().WithId("cn.left.dot").WithInitialSize(10).FromComponentInNewPrefab(NotePrefabContainer(note.NoteDotLeft)); } if (note.NoteDotRight != null) { Container.BindMemoryPool <SiraPrefabContainer, SiraPrefabContainer.Pool>().WithId("cn.right.dot").WithInitialSize(10).FromComponentInNewPrefab(NotePrefabContainer(note.NoteDotRight)); } } }
public static void BindEntityMonoPool <TView, T1, T2, TMonoPool, TFactory>(this DiContainer container) where TView : EntityView where TMonoPool : EntityMonoPool <T1, T2, TView> where TFactory : IEntityFactory <TView> { container.BindMemoryPool <TView, TMonoPool>() .FromFactory <TFactory>(); }
public void Construct(NoteAssetLoader _noteAssetLoader, DiContainer Container, GameplayCoreSceneSetupData sceneSetupData) { CanSetup = !(sceneSetupData.gameplayModifiers.ghostNotes || sceneSetupData.gameplayModifiers.disappearingArrows) || !Container.HasBinding <MultiplayerLevelSceneSetupData>(); if (_noteAssetLoader.SelectedNote != 0 && CanSetup) { var note = _noteAssetLoader.CustomNoteObjects[_noteAssetLoader.SelectedNote]; MaterialSwapper.GetMaterials(); MaterialSwapper.ReplaceMaterialsForGameObject(note.NoteBomb); Container.BindMemoryPool <SiraPrefabContainer, SiraPrefabContainer.Pool>().WithId("cn.bomb").WithInitialSize(10).FromComponentInNewPrefab(NotePrefabContainer(note.NoteBomb)); } }
public ShotFactory(Engine engine, SignalBus signalBus, DiContainer container) { _signalBus = signalBus; _engine = engine; container.BindMemoryPool <ShotOneView, ShotOneView.Pool>() .WithInitialSize(PollCount) .FromComponentInNewPrefabResource("ShotEntity") .UnderTransformGroup("Pool_ShotEntity"); _pool = container.Resolve <ShotOneView.Pool>(); }
public FlyingTextEffect Modify(FlyingTextEffect original) { if (_container != null) { AnimationCurve fade = original.GetField <AnimationCurve, FlyingTextEffect>("_fadeAnimationCurve"); AnimationCurve move = original.GetField <AnimationCurve, FlyingObjectEffect>("_moveAnimationCurve"); _container.BindMemoryPool <FlyingTextEffect, FlyingTextEffect.Pool>().WithInitialSize(20).FromComponentInNewPrefab(CreateFlyingTextEffectPrefab(fade, move)).WhenInjectedInto <ItalicizedFlyingTextSpawner>(); } return(original); }
public PlayerFactory(Engine engine, SignalBus signalBus, DiContainer container, WeaponsController weaponsController) { _weaponsController = weaponsController; _container = container; _signalBus = signalBus; _engine = engine; container.BindMemoryPool <PlayerView, PlayerView.Pool>() .WithInitialSize(PollCount) .FromComponentInNewPrefabResource("PlayerEntity") .UnderTransformGroup("Pool_PlayerEntity"); _pool = container.Resolve <PlayerView.Pool>(); }
public EnemyFactory(Engine engine, SignalBus signalBus, DiContainer container) { _container = container; _signalBus = signalBus; _engine = engine; container.BindMemoryPool <EnemyView, EnemyView.Pool>() .WithInitialSize(PollCount) .FromComponentInNewPrefabResource("EnemyView_One") .UnderTransformGroup("Pool_EnemyView_One"); _pool = container.Resolve <EnemyView.Pool>(); }
public void SetUp() { container = new DiContainer(); raycastSystem = Substitute.For <IRaycastSystem>(); container.Bind <IRaycastSystem>().FromInstance(raycastSystem).AsSingle(); aRObject = Substitute.For <IARObject>(); container.BindMemoryPool <IARObject, ARObjectPool>().FromInstance(aRObject); aRObjectAlignment = Substitute.For <IARObjectAlignment>(); container.Bind <IARObjectAlignment>().FromInstance(aRObjectAlignment); cameraSystem = Substitute.For <ICameraSystem>(); container.Bind <ICameraSystem>().FromInstance(cameraSystem); container.Bind(typeof(ARObjectSpawner)).To <ARObjectSpawner>().AsSingle(); container.Inject(this); }