Signed-off-by: TRAfoer <lhf190@outlook.com>

This commit is contained in:
2025-07-17 16:44:38 +08:00
parent 015a174afc
commit 55af142af3
29 changed files with 17816 additions and 16619 deletions

View File

@@ -20,13 +20,9 @@ namespace Ichni.RhythmGame
{
Flick flick = Instantiate(EditorManager.instance.basePrefabs.flickNote, parentElement.transform)
.GetComponent<Flick>();
if (EditorManager.instance.useNotePrefab)
{
isFirstGenerated = false;
}
flick.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
flick.Initialize(elementName, id, tags, EditorManager.instance.useNotePrefab ? false : isFirstGenerated, parentElement);
flick.exactJudgeTime = exactJudgeTime;
flick.availableFlickDirections = directions;
@@ -50,10 +46,10 @@ namespace Ichni.RhythmGame
flick.track = null;
flick.isOnTrack = false;
}
if (EditorManager.instance.useNotePrefab)
if (EditorManager.instance.useNotePrefab && isFirstGenerated)
{
EditorManager.instance.projectManager.notePrefabManager.LoadNotePrefab(flick,GetNoteTypeName(flick) + "_Prefab");
EditorManager.instance.projectManager.notePrefabManager.LoadNotePrefab(flick, GetNoteTypeName(flick) + "_Prefab");
}
return flick;
@@ -65,19 +61,19 @@ namespace Ichni.RhythmGame
public override void SetDefaultSubmodules()
{
base.SetDefaultSubmodules();
noteAudioSubmodule = new NoteAudioSubmodule(this, "DefaultStay");
noteAudioSubmodule ??= new NoteAudioSubmodule(this, "DefaultStay");
}
public override void SaveBM()
{
matchedBM = new Flick_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
matchedBM = new Flick_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM,
exactJudgeTime, availableFlickDirections);
}
public override void SetUpInspector()
{
base.SetUpInspector();
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var flickSpecial = inspector.GenerateContainer("Flick Special");
@@ -117,7 +113,7 @@ namespace Ichni.RhythmGame
public override GameElement DuplicateBM(GameElement parent)
{
return Flick.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent,
return Flick.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent,
exactJudgeTime, availableFlickDirections);
}
}

View File

@@ -26,12 +26,9 @@ namespace Ichni.RhythmGame
Hold hold = Instantiate(EditorManager.instance.basePrefabs.holdNote, parentElement.transform)
.GetComponent<Hold>();
if (EditorManager.instance.useNotePrefab)
{
isFirstGenerated = false;
}
hold.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
hold.Initialize(elementName, id, tags, EditorManager.instance.useNotePrefab ? false : isFirstGenerated, parentElement);
hold.exactJudgeTime = exactJudgeTime;
hold.holdEndTime = holdEndTime;
hold.holdingTime = 0;
@@ -58,7 +55,7 @@ namespace Ichni.RhythmGame
hold.isOnTrack = false;
}
if (EditorManager.instance.useNotePrefab)
if (EditorManager.instance.useNotePrefab && isFirstGenerated)
{
EditorManager.instance.projectManager.notePrefabManager.LoadNotePrefab(hold, GetNoteTypeName(hold) + "_Prefab");
}
@@ -97,7 +94,7 @@ namespace Ichni.RhythmGame
public override void SetDefaultSubmodules()
{
base.SetDefaultSubmodules();
noteAudioSubmodule = new NoteAudioSubmodule(this, "DefaultTap");
noteAudioSubmodule ??= new NoteAudioSubmodule(this, "DefaultTap");
}
public override void SaveBM()
@@ -138,13 +135,13 @@ namespace Ichni.RhythmGame
{
if (Keyboard.current.hKey.wasPressedThisFrame)
{
foreach (KeyValuePair<string,List<EffectBase>> effect in noteVisual.effectSubmodule.effectCollection)
foreach (KeyValuePair<string, List<EffectBase>> effect in noteVisual.effectSubmodule.effectCollection)
{
effect.Value.ForEach(x => x.Disrupt());
}
}
if (holdEndTime < exactJudgeTime)
{
LogWindow.Log("Hold end time is earlier than exact judge time.", Color.red);
@@ -206,7 +203,7 @@ namespace Ichni.RhythmGame
noteVisual.effectSubmodule.effectCollection["StartHold"].ForEach(e => e.UpdateEffect(exactJudgeTime));
noteVisual.effectSubmodule.effectCollection["Holding"].ForEach(e => e.UpdateEffect(exactJudgeTime));
noteVisual.effectSubmodule.effectCollection["GeneralJudge"].ForEach(e => e.UpdateEffect(holdEndTime));
switch (EditorManager.instance.currentJudgeType)
{
@@ -223,7 +220,7 @@ namespace Ichni.RhythmGame
noteVisual.effectSubmodule.effectCollection["Miss"].ForEach(e => e.UpdateEffect(holdEndTime));
break;
}
noteVisual.effectSubmodule.effectCollection["AfterJudge"].ForEach(e => e.UpdateEffect(holdEndTime));
if (EditorManager.instance.cameraManager.haveGameCamera)

View File

@@ -61,8 +61,8 @@ namespace Ichni.RhythmGame
public override void SetDefaultSubmodules()
{
timeDurationSubmodule = new TimeDurationSubmodule(this);
noteJudgeSubmodule = new NoteJudgeSubmodule(this);
timeDurationSubmodule ??= new TimeDurationSubmodule(this);
noteJudgeSubmodule ??= new NoteJudgeSubmodule(this);
}
public override void Refresh()
{
@@ -74,6 +74,8 @@ namespace Ichni.RhythmGame
{
noteVisual.Refresh();
}
foreach (SampleWindow i in SampleWindow.instances.Where(i => i.gameElement)) i.OnceSpawnNote();
}
protected virtual void Update()
{

View File

@@ -16,15 +16,12 @@ namespace Ichni.RhythmGame
GameElement parentElement, float exactJudgeTime)
{
Stay stay = Instantiate(EditorManager.instance.basePrefabs.stayNote, parentElement.transform).GetComponent<Stay>();
if (EditorManager.instance.useNotePrefab)
{
isFirstGenerated = false;
}
stay.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
stay.Initialize(elementName, id, tags, EditorManager.instance.useNotePrefab ? false : isFirstGenerated, parentElement);
stay.exactJudgeTime = exactJudgeTime;
if (parentElement.TryGetComponent(out Track track))
{
if (track.trackTimeSubmodule != null)
@@ -45,22 +42,22 @@ namespace Ichni.RhythmGame
stay.track = null;
stay.isOnTrack = false;
}
if (EditorManager.instance.useNotePrefab)
if (EditorManager.instance.useNotePrefab && isFirstGenerated)
{
EditorManager.instance.projectManager.notePrefabManager.LoadNotePrefab(stay,GetNoteTypeName(stay) + "_Prefab");
EditorManager.instance.projectManager.notePrefabManager.LoadNotePrefab(stay, GetNoteTypeName(stay) + "_Prefab");
}
return stay;
}
}
public partial class Stay
{
public override void SetDefaultSubmodules()
{
base.SetDefaultSubmodules();
noteAudioSubmodule = new NoteAudioSubmodule(this, "DefaultStay");
noteAudioSubmodule ??= new NoteAudioSubmodule(this, "DefaultStay");
}
public override void SaveBM()
@@ -68,25 +65,25 @@ namespace Ichni.RhythmGame
matchedBM = new Stay_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM, exactJudgeTime);
}
}
namespace Beatmap
{
public class Stay_BM : NoteBase_BM
{
public Stay_BM()
{
}
public Stay_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement, float exactJudgeTime)
public Stay_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement, float exactJudgeTime)
: base(elementName, elementGuid, tags, attachedElement, exactJudgeTime)
{
}
public override void ExecuteBM()
{
matchedElement = Stay.GenerateElement(elementName, elementGuid, tags, false,
matchedElement = Stay.GenerateElement(elementName, elementGuid, tags, false,
GetElement(attachedElementGuid), exactJudgeTime);
}

View File

@@ -17,13 +17,8 @@ namespace Ichni.RhythmGame
{
Tap tap = Instantiate(EditorManager.instance.basePrefabs.tapNote, parentElement.transform)
.GetComponent<Tap>();
if (EditorManager.instance.useNotePrefab)
{
isFirstGenerated = false;
}
tap.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
tap.Initialize(elementName, id, tags, EditorManager.instance.useNotePrefab ? false : isFirstGenerated, parentElement);
tap.exactJudgeTime = exactJudgeTime;
if (parentElement.TryGetComponent(out Track track))
@@ -46,10 +41,10 @@ namespace Ichni.RhythmGame
tap.track = null;
tap.isOnTrack = false;
}
if (EditorManager.instance.useNotePrefab)
if (EditorManager.instance.useNotePrefab && isFirstGenerated)
{
EditorManager.instance.projectManager.notePrefabManager.LoadNotePrefab(tap,GetNoteTypeName(tap) + "_Prefab");
EditorManager.instance.projectManager.notePrefabManager.LoadNotePrefab(tap, GetNoteTypeName(tap) + "_Prefab");
}
return tap;
@@ -61,7 +56,7 @@ namespace Ichni.RhythmGame
public override void SetDefaultSubmodules()
{
base.SetDefaultSubmodules();
noteAudioSubmodule = new NoteAudioSubmodule(this, "DefaultTap");
noteAudioSubmodule ??= new NoteAudioSubmodule(this, "DefaultTap");
}
public override void SaveBM()

View File

@@ -8,6 +8,7 @@ namespace Ichni.RhythmGame
{
public partial class Track
{
public TrackNoteEditor trackNoteEditor;
/// <summary>
/// 快速复制粘贴Track
/// </summary>
@@ -86,7 +87,7 @@ namespace Ichni.RhythmGame
pn.transformSubmodule.Refresh();
});
}
/// <summary>
/// Track整体旋转
/// </summary>
@@ -100,7 +101,7 @@ namespace Ichni.RhythmGame
LogWindow.Log("Axis direction cannot be zero!", Color.red);
return;
}
trackPathSubmodule.pathNodeList.ForEach(pn =>
{
Vector3 originalPosition = pn.transformSubmodule.originalPosition;
@@ -109,7 +110,7 @@ namespace Ichni.RhythmGame
pn.transformSubmodule.Refresh();
});
}
/// <summary>
/// Track整体翻转
/// </summary>
@@ -125,7 +126,7 @@ namespace Ichni.RhythmGame
pn.transformSubmodule.Refresh();
});
}
/// <summary>
/// 仅开启起点和终点的PathNode的Sphere显示中间的PathNode不显示
/// </summary>
@@ -136,7 +137,7 @@ namespace Ichni.RhythmGame
LogWindow.Log("PathNode amount is less than 2!", Color.red);
return;
}
trackPathSubmodule.pathNodeList[0].SetPathNodeSphere(true);
trackPathSubmodule.pathNodeList[^1].SetPathNodeSphere(true);
for (int i = 1; i < trackPathSubmodule.pathNodeList.Count - 1; i++)