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 void OnGameSceneLoaded() { CustomNote activeNote = NoteAssetLoader.CustomNoteObjects[NoteAssetLoader.SelectedNote]; if (activeNote.FileName != "DefaultNotes") { MaterialSwapper.GetMaterials(); MaterialSwapper.ReplaceMaterialsForGameObject(activeNote.NoteLeft); MaterialSwapper.ReplaceMaterialsForGameObject(activeNote.NoteRight); if (activeNote.NoteDotLeft != null) { MaterialSwapper.ReplaceMaterialsForGameObject(activeNote.NoteDotLeft); } if (activeNote.NoteDotRight != null) { MaterialSwapper.ReplaceMaterialsForGameObject(activeNote.NoteDotRight); } if (activeNote.NoteBomb != null) { MaterialSwapper.ReplaceMaterialsForGameObject(activeNote.NoteBomb); } CheckCustomNotesScoreDisable(); } else if (ScoreUtility.ScoreIsBlocked) { ScoreUtility.EnableScoreSubmission("ModifiersEnabled"); } }
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 override void InstallBindings() { bool autoDisable = _pluginConfig.AutoDisable && (_gameplayCoreSceneSetupData.gameplayModifiers.ghostNotes || _gameplayCoreSceneSetupData.gameplayModifiers.disappearingArrows || _gameplayCoreSceneSetupData.gameplayModifiers.smallCubes || Utils.IsNoodleMap(_gameplayCoreSceneSetupData.difficultyBeatmap)); _shouldSetup = !autoDisable && (!(_gameplayCoreSceneSetupData.gameplayModifiers.ghostNotes || _gameplayCoreSceneSetupData.gameplayModifiers.disappearingArrows) || !Container.HasBinding <MultiplayerLevelSceneSetupData>()); if (_pluginConfig.Enabled && _noteAssetLoader.SelectedNote != 0 && _shouldSetup) { Container.BindInterfacesAndSelfTo <GameCameraManager>().AsSingle(); Container.Bind <IInitializable>().To <CustomNoteManager>().AsSingle(); CustomNote note = _noteAssetLoader.CustomNoteObjects[_noteAssetLoader.SelectedNote]; #region Note Setup Container.RegisterRedecorator(new BasicNoteRegistration(DecorateNote, DECORATION_PRIORITY)); 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(Protocol.LeftArrowPool).WithInitialSize(25).FromComponentInNewPrefab(NotePrefabContainer(note.NoteLeft)); Container.BindMemoryPool <SiraPrefabContainer, SiraPrefabContainer.Pool>().WithId(Protocol.RightArrowPool).WithInitialSize(25).FromComponentInNewPrefab(NotePrefabContainer(note.NoteRight)); if (note.NoteDotLeft != null) { Container.BindMemoryPool <SiraPrefabContainer, SiraPrefabContainer.Pool>().WithId(Protocol.LeftDotPool).WithInitialSize(10).FromComponentInNewPrefab(NotePrefabContainer(note.NoteDotLeft)); } if (note.NoteDotRight != null) { Container.BindMemoryPool <SiraPrefabContainer, SiraPrefabContainer.Pool>().WithId(Protocol.RightDotPool).WithInitialSize(10).FromComponentInNewPrefab(NotePrefabContainer(note.NoteDotRight)); } #endregion #region Bomb Setup if (note.NoteBomb != null) { MaterialSwapper.GetMaterials(); MaterialSwapper.ReplaceMaterialsForGameObject(note.NoteBomb); Container.BindMemoryPool <SiraPrefabContainer, SiraPrefabContainer.Pool>().WithId(Protocol.BombPool).WithInitialSize(10).FromComponentInNewPrefab(NotePrefabContainer(note.NoteBomb)); Container.RegisterRedecorator(new BombNoteRegistration(DecorateBombs, DECORATION_PRIORITY)); } #endregion } }