83 lines
2.8 KiB
C#
83 lines
2.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using DG.Tweening;
|
|
using Ichni.Editor;
|
|
using Ichni.RhythmGame.Beatmap;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame.ThemeBundles.Basic
|
|
{
|
|
public class BasicNoteBadShrink : NoteBadEffect
|
|
{
|
|
Renderer noteMainRenderer;
|
|
public BasicNoteBadShrink(NoteVisualBase noteVisual)
|
|
{
|
|
this.note = noteVisual.note;
|
|
this.noteVisual = note.noteVisual;
|
|
this.noteMainRenderer = noteVisual.noteMain.GetComponent<Renderer>();
|
|
this.effectTime = 0.1f;
|
|
}
|
|
|
|
public override void Recover()
|
|
{
|
|
noteVisual.noteMain.SetActive(true);
|
|
noteVisual.noteMain.transform.localScale = Vector3.one;
|
|
noteMainRenderer.material.SetColor("_BaseColor", Color.white);
|
|
|
|
if (noteVisual is BasicHoldVisualMesh holdVisualMesh)
|
|
{
|
|
holdVisualMesh.notePartList[1].SetActive(true);
|
|
holdVisualMesh.notePartList[2].SetActive(true);
|
|
}
|
|
}
|
|
|
|
public override void Adjust()
|
|
{
|
|
noteMainRenderer.material.DOColor(Color.clear, effectTime).SetEase(Ease.OutQuad);
|
|
noteVisual.noteMain.transform.DOScale(Vector3.zero, effectTime).SetEase(Ease.OutQuad).OnComplete(() =>
|
|
{
|
|
noteVisual.noteMain.SetActive(false);
|
|
|
|
if (noteVisual is BasicHoldVisualMesh holdVisualMesh)
|
|
{
|
|
holdVisualMesh.notePartList[1].SetActive(false);
|
|
holdVisualMesh.notePartList[2].SetActive(false);
|
|
}
|
|
});
|
|
}
|
|
|
|
public override EffectBase_BM ConvertToBM()
|
|
{
|
|
return new Beatmap.BasicNoteBadShrink_BM(effectTime);
|
|
}
|
|
|
|
public override void SetUpInspector()
|
|
{
|
|
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
|
var container = inspector.GenerateContainer("Basic Note Bad Shrink");
|
|
var effectTimeField = inspector.GenerateInputField(this, container, "Effect Time", nameof(effectTime));
|
|
}
|
|
}
|
|
|
|
namespace Beatmap
|
|
{
|
|
public class BasicNoteBadShrink_BM : NoteBadEffect_BM
|
|
{
|
|
public BasicNoteBadShrink_BM()
|
|
{
|
|
|
|
}
|
|
|
|
public BasicNoteBadShrink_BM(float effectTime) : base(effectTime)
|
|
{
|
|
|
|
}
|
|
|
|
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
|
{
|
|
return new BasicNoteBadShrink(attachedGameElement as NoteVisualBase);
|
|
}
|
|
}
|
|
}
|
|
} |