Files
ichni_Official/Assets/ThemeBundles/DepartureToMultiverse/Scripts/NoteEffect/DTMNoteMissTransparent.cs

99 lines
2.8 KiB
C#
Raw Normal View History

2025-06-03 02:42:28 -04:00
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Ichni.RhythmGame.Beatmap;
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap;
using UnityEngine;
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
{
public class DTMNoteMissTransparent : NoteMissEffect
{
public List<Renderer> noteRenderers;
public DTMNoteMissTransparent(NoteVisualBase noteVisual, float effectTime)
{
this.note = noteVisual.note;
this.noteVisual = noteVisual;
this.effectTime = effectTime;
this.noteRenderers = new List<Renderer>();
2025-07-21 05:42:20 -04:00
foreach (GameObject part in noteVisual.notePartList)
2025-06-03 02:42:28 -04:00
{
2025-07-21 05:42:20 -04:00
Renderer rend = part.GetComponent<Renderer>();
if(rend != null)
{
noteRenderers.Add(rend);
}
2025-06-03 02:42:28 -04:00
}
2025-08-22 14:54:40 -04:00
if (noteVisual is DTMNoteVisualHold)
{
this.effectTime *= 2f;
}
2025-06-03 02:42:28 -04:00
}
public override void Recover()
{
noteVisual.noteMain.SetActive(true);
foreach (var renderer in noteRenderers)
{
2025-09-14 14:53:45 -04:00
renderer.materials.For(m => m.SetFloat("_MainAlpha", 1f));
}
}
public override void PreExecute()
{
if (noteVisual is DTMNoteVisualHold)
{
noteRenderers[0].materials[1].SetFloat("_GlowIntensity", 0.25f);
2025-06-03 02:42:28 -04:00
}
}
public override void Execute()
{
float e = AnimationCurveEvaluator.Evaluate(AnimationCurveType.OutQuad, effectProgressPercent);
2025-08-22 14:54:40 -04:00
float alpha = (1 - e) / 3f;
2025-06-03 02:42:28 -04:00
foreach (var renderer in noteRenderers)
{
2025-09-14 14:53:45 -04:00
renderer.materials.For(m => m.SetFloat("_MainAlpha", alpha));
2025-06-03 02:42:28 -04:00
}
}
public override void Adjust()
{
noteVisual.noteMain.SetActive(false);
foreach (var renderer in noteRenderers)
{
2025-09-14 14:53:45 -04:00
renderer.materials.For(m => m.SetFloat("_MainAlpha", 1f));
2025-06-03 02:42:28 -04:00
}
}
public override EffectBase_BM ConvertToBM()
{
return new DTMNoteMissTransparent_BM(effectTime);
}
}
namespace Beatmap
{
public class DTMNoteMissTransparent_BM : NoteMissEffect_BM
{
public DTMNoteMissTransparent_BM()
{
}
public DTMNoteMissTransparent_BM(float effectTime) : base(effectTime)
{
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new DTMNoteMissTransparent(attachedGameElement as NoteVisualBase, effectTime);
}
}
}
}