基础内容-6

技术性调整;
Note效果;
This commit is contained in:
SoulliesOfficial
2025-01-30 22:45:33 -05:00
parent 39b4a5e7ff
commit 5f64c4faf8
47 changed files with 493 additions and 205 deletions

View File

@@ -1,18 +1,56 @@
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using Ichni.RhythmGame;
using UnityEngine;
public class BasicNoteGenerateExpand : MonoBehaviour
namespace Ichni.RhythmGame.ThemeBundles.Basic
{
// Start is called before the first frame update
void Start()
public class BasicNoteGenerateExpand : NoteEffectBase
{
}
public float generateTime;
// Update is called once per frame
void Update()
{
public BasicNoteGenerateExpand(NoteBase note)
{
this.note = note;
this.generateTime = 1f;
this.effectTime = 0.1f;
this.noteVisual = note.noteVisual.GetComponent<BasicNoteVisual>();
}
public override void Recover()
{
noteVisual.noteMain.SetActive(false);
noteVisual.noteMain.transform.localScale = Vector3.zero;
}
public override void Adjust()
{
noteVisual.noteMain.SetActive(true);
noteVisual.noteMain.transform.DOScale(Vector3.one, 0.1f).SetEase(Ease.OutBack);
}
public override EffectState CheckEffectState()
{
float songTime = EditorManager.instance.songModule.songTime;
if (songTime < note.exactJudgeTime - generateTime)
{
return EffectState.Before;
}
if (songTime >= note.exactJudgeTime - generateTime &&
songTime <= note.exactJudgeTime - generateTime + effectTime)
{
return EffectState.Middle;
}
if (songTime > note.exactJudgeTime - generateTime + effectTime)
{
return EffectState.After;
}
return EffectState.Error;
}
}
}
}

View File

@@ -9,7 +9,7 @@ namespace Ichni.RhythmGame.ThemeBundles.Basic
{
private GameObject effectRing;
public void Initialize(NoteBase note)
public BasicNotePerfectBurst(NoteBase note)
{
this.note = note;
this.noteVisual = note.noteVisual.GetComponent<BasicNoteVisual>();
@@ -31,5 +31,28 @@ namespace Ichni.RhythmGame.ThemeBundles.Basic
effectRing.GetComponent<SpriteRenderer>().DOFade(0, 0.1f).SetEase(Ease.OutBack).OnComplete(() => effectRing.SetActive(false));
noteVisual.noteMain.SetActive(false);
}
public override EffectState CheckEffectState()
{
float songTime = EditorManager.instance.songModule.songTime;
if (songTime < note.exactJudgeTime )
{
return EffectState.Before;
}
if (songTime >= note.exactJudgeTime &&
songTime <= note.exactJudgeTime + effectTime)
{
return EffectState.Middle;
}
if (songTime > note.exactJudgeTime + effectTime)
{
return EffectState.After;
}
return EffectState.Error;
}
}
}

View File

@@ -1,11 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
using UnityEngine;
namespace Ichni.RhythmGame.ThemeBundles.Basic
{
public class BasicNoteVisual : NoteVisualBase
{
public new static BasicNoteVisual GenerateElement(string elementName, string themeBundleName,
string objectName, Vector3 position, Vector3 eulerAngles, Vector3 scale, BaseElement parent,
bool isFirstGenerated = true)
{
BasicNoteVisual noteVisual = SubstantialObject
.GenerateElement(elementName, themeBundleName, objectName, position, eulerAngles, scale, parent, isFirstGenerated)
.GetComponent<BasicNoteVisual>();
NoteBase note = parent as NoteBase;
if(note == null) throw new System.Exception("NoteVisual只能生成在Note下。");
noteVisual.note = note;
note.noteVisual = noteVisual;
if (isFirstGenerated)
{
note.generateEffects.effectList.Add(new BasicNoteGenerateExpand(noteVisual.note));
note.perfectJudgeEffects.effectList.Add(new BasicNotePerfectBurst(noteVisual.note));
}
return noteVisual;
}
}
}