97 lines
3.0 KiB
C#
97 lines
3.0 KiB
C#
using Ichni.Editor;
|
|
using Ichni.RhythmGame.Beatmap;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
|
{
|
|
public class DTMNoteGenerateExpand : NoteGenerateEffect
|
|
{
|
|
public DTMNoteGenerateExpand(NoteVisualBase noteVisual, float generateTime, float effectTime)
|
|
{
|
|
this.note = noteVisual.note;
|
|
this.noteVisual = noteVisual;
|
|
this.generateTime = generateTime;
|
|
this.effectTime = effectTime;
|
|
}
|
|
|
|
public sealed override void Recover()
|
|
{
|
|
noteVisual.noteMain.SetActive(false);
|
|
if (noteVisual is DTMNoteVisualHold noteVisualHold)
|
|
{
|
|
noteVisualHold.meshGenerator.size = 0;
|
|
}
|
|
else
|
|
{
|
|
noteVisual.noteMain.transform.localScale = Vector3.zero;
|
|
}
|
|
}
|
|
|
|
public override void PreExecute()
|
|
{
|
|
noteVisual.noteMain.SetActive(true);
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
float e = AnimationCurveEvaluator.Evaluate(AnimationCurveType.OutQuad, effectProgressPercent);
|
|
if (noteVisual is DTMNoteVisualHold noteVisualHold)
|
|
{
|
|
noteVisualHold.meshGenerator.size = e;
|
|
}
|
|
else
|
|
{
|
|
noteVisual.noteMain.transform.localScale = e * Vector3.one;
|
|
}
|
|
}
|
|
|
|
public override void Adjust()
|
|
{
|
|
if (noteVisual is DTMNoteVisualHold noteVisualHold)
|
|
{
|
|
noteVisualHold.meshGenerator.size = 1;
|
|
}
|
|
else
|
|
{
|
|
noteVisual.noteMain.transform.localScale = Vector3.one;
|
|
}
|
|
}
|
|
|
|
public override EffectBase_BM ConvertToBM()
|
|
{
|
|
return new Beatmap.DTMNoteGenerateExpand_BM(effectTime, generateTime);
|
|
}
|
|
|
|
public override void SetUpInspector()
|
|
{
|
|
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
|
var container = inspector.GenerateContainer("DTM Note Generate Expand");
|
|
var subcontainer = container.GenerateSubcontainer(3);
|
|
var generateTimeField = inspector.GenerateInputField(this, subcontainer, "Generate Time", nameof(generateTime));
|
|
var effectTimeField = inspector.GenerateInputField(this, subcontainer, "Effect Time", nameof(effectTime));
|
|
}
|
|
}
|
|
|
|
namespace Beatmap
|
|
{
|
|
public class DTMNoteGenerateExpand_BM : NoteGenerateEffect_BM
|
|
{
|
|
public DTMNoteGenerateExpand_BM()
|
|
{
|
|
|
|
}
|
|
|
|
public DTMNoteGenerateExpand_BM(float effectTime, float generateTime) :
|
|
base(effectTime, generateTime)
|
|
{
|
|
|
|
}
|
|
|
|
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
|
{
|
|
return new DTMNoteGenerateExpand(attachedGameElement as NoteVisualBase, generateTime, effectTime);
|
|
}
|
|
}
|
|
}
|
|
}
|