private static void Prefix(NoteController noteController, ref ColorManager ____colorManager) { try { CustomNote activeNote = NoteAssetLoader.CustomNoteObjects[NoteAssetLoader.SelectedNote]; if (activeNote.FileName != "DefaultNotes") { // Attempt to find both the custom ArrowNote and the custom DotNote Transform child = noteController.gameObject.transform.Find("NoteCube"); GameObject customNote = null; GameObject recolorizeCustomNote = null; string name = string.Empty; switch (noteController.noteData.colorType) { case ColorType.ColorA: customNote = GetCustomNote(child, activeNote.NoteLeft, activeNote.NoteDotLeft, noteController.noteData.cutDirection, out name, out recolorizeCustomNote); break; case ColorType.ColorB: customNote = GetCustomNote(child, activeNote.NoteRight, activeNote.NoteDotRight, noteController.noteData.cutDirection, out name, out recolorizeCustomNote); break; default: break; } if (customNote != null) { // Custom Note of type Arrow/Dot not spawned yet for new default note object GameObject fakeMesh = UnityEngine.Object.Instantiate(customNote); fakeMesh.name = name; fakeMesh.transform.SetParent(child); fakeMesh.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f); fakeMesh.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f); fakeMesh.transform.Rotate(new Vector3(0, 0, 0), Space.Self); fakeMesh.transform.localRotation = fakeMesh.transform.localRotation * child.parent.localRotation; // correct for 360 levels if (activeNote.Descriptor.UsesNoteColor) { Utils.ColorizeCustomNote(____colorManager.ColorForType(noteController.noteData.colorType), activeNote.Descriptor.NoteColorStrength, fakeMesh); } } else if (activeNote.Descriptor.UsesNoteColor && recolorizeCustomNote != null) { Utils.ColorizeCustomNote(____colorManager.ColorForType(noteController.noteData.colorType), activeNote.Descriptor.NoteColorStrength, recolorizeCustomNote); } } } catch (Exception ex) { Logger.log.Error(ex); } }
private void InitializePreviewNotes(CustomNote customNote, Transform transform) { // Position previewer based on the CustomNote having a NoteBomb preview.transform.position = customNote.NoteBomb ? new Vector3(2.1f, 0.9f, 1.60f) : new Vector3(2.25f, 0.9f, 1.45f); noteLeft = CreatePreviewNote(customNote.NoteLeft, transform, leftArrowPos); noteDotLeft = CreatePreviewNote(customNote.NoteDotLeft, transform, leftDotPos); noteRight = CreatePreviewNote(customNote.NoteRight, transform, rightArrowPos); noteDotRight = CreatePreviewNote(customNote.NoteDotRight, transform, rightDotPos); noteBomb = CreatePreviewNote(customNote.NoteBomb, transform, bombPos); // Fake the Note Dots if no CustomNote Dot existed in the CustomNote if (noteLeft && !noteDotLeft) { noteDotLeft = CreatePreviewNote(customNote.NoteLeft, transform, leftDotPos); } if (noteRight && !noteDotRight) { noteDotRight = CreatePreviewNote(customNote.NoteRight, transform, rightDotPos); } // Add arrows to arrowless notes if (!customNote.Descriptor.DisableBaseNoteArrows && fakeNoteArrows != null) { if (noteLeft && noteRight) { AddNoteArrows(fakeNoteArrows, transform); } } if (customNote.Descriptor.UsesNoteColor) { ColorManager colorManager = Resources.FindObjectsOfTypeAll <ColorManager>().First(); if (colorManager) { float colorStrength = customNote.Descriptor.NoteColorStrength; Color noteAColor = colorManager.ColorForType(ColorType.ColorA); Color noteBColor = colorManager.ColorForType(ColorType.ColorB); Utils.ColorizeCustomNote(noteAColor, colorStrength, noteLeft); Utils.ColorizeCustomNote(noteBColor, colorStrength, noteRight); Utils.ColorizeCustomNote(noteBColor, colorStrength, noteDotRight); Utils.ColorizeCustomNote(noteAColor, colorStrength, noteDotLeft); } else { Logger.log.Warn("Failed to locate a suitable ColorManager for the CustomNote preview"); } } }
internal Color ColorForCNVManager() { EnableNoteColorOverride(_nc); Color noteColor = _colorManager.ColorForType(_noteData.colorType); DisableNoteColorOverride(); return(noteColor); }
public void DisableNoteColors() { if (interceptingLightshow != null) { interceptingLightshow.OnInterceptedNoteColors(null, null, -1f); return; } if (enabled) { disableNoteColorsOn = -1f; SetEnabled(); } useCustomNoteColors = false; UpdateNoteColors(colorManager.ColorForType(ColorType.ColorA), colorManager.ColorForType(ColorType.ColorB)); }
private void ChangeColors() { Color color = materialColorType switch { MaterialColorType.SaberColorA => _colorManager.ColorForSaberType(SaberType.SaberA), MaterialColorType.SaberColorB => _colorManager.ColorForSaberType(SaberType.SaberB), MaterialColorType.ColorTypeA => _colorManager.ColorForType(ColorType.ColorA), MaterialColorType.ColorTypeB => _colorManager.ColorForType(ColorType.ColorB), MaterialColorType.ObstacleColor => _colorManager.GetObstacleEffectColor(), _ => new Color(0f, 0f, 0f), }; if (_renderer.material.HasProperty(propertyName)) { _renderer.material.SetColor(propertyName, color); } else { _renderer.material.color = color; } }
private void NoteWasCut(NoteData data, NoteCutInfo info, int multiplier) { Color32 color = cm.ColorForType(data.colorType); tcp.SendData(new RgbObject() { type = "PULSE", r = color.r, g = color.g, b = color.b }); }
private void SetCubeState(NoteController noteController, NoteCutInfo noteCutInfo, NoteData noteData, float cubeRotation) { float cubeX; float cubeY; if (_config.PositionFromCubeTransform) { const float positionScaling = 2.0f; var position = noteController.noteTransform.position * positionScaling; cubeX = position.x; cubeY = position.y; } else { var positionOffset = new Vector2(-1.5f, 1.5f); cubeX = noteData.lineIndex + positionOffset.x; cubeY = (int)noteData.noteLineLayer + positionOffset.y; } _aliveTime = 0f; _isDirectional = noteData.cutDirection != NoteCutDirection.Any && noteData.cutDirection != NoteCutDirection.None; if (_config.UseCustomColors) { _color = noteData.colorType == ColorType.ColorA ? _config.LeftColor : _config.RightColor; _saberColor = noteCutInfo.saberType == SaberType.SaberA ? _config.LeftColor : _config.RightColor; } else { // This should work due to colors of both type A and B match for their respective saber and blocks _color = _colorManager.ColorForType(noteData.colorType); _saberColor = _colorManager.ColorForSaberType(noteCutInfo.saberType); } _background.color = _color; _blockTransform.localRotation = Quaternion.Euler(0f, 0f, cubeRotation); _blockTransform.localPosition = new Vector3(cubeX, cubeY, 0f); var arrowAlpha = _isDirectional ? 1f : 0f; _arrow.color = Fade(_config.ArrowColor, arrowAlpha); }
static void Postfix(ColorNoteVisuals __instance, NoteController ____noteController, MaterialPropertyBlockController[] ____materialPropertyBlockControllers, int ____colorId, ref ColorManager ____colorManager) { if (!NiceMissManager.modActive) { return; } // Debug.Log("ColorNoteVis Init"); var outline = ____noteController.gameObject.GetComponentInChildren <Outline>(); if (outline == null) { // Debug.Log("Outline Not Found"); outline = ____noteController.gameObject.AddComponent <Outline>(); } Color c = ____colorManager.ColorForType(____noteController.noteData.colorType); outline.CheckRenderersValidity(); outline.enabled = false; outline.OutlineMode = Outline.Mode.OutlineVisible; outline.OutlineColor = c; outline.OutlineWidth = PluginConfig.Instance.OutlineWidth; }