This commit is contained in:
SoulliesOfficial
2026-06-12 03:17:18 -04:00
parent 997d187147
commit 4770905b33
9 changed files with 19086 additions and 18556 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Ichni.Editor;
using Lean.Pool;
using UnityEngine;
@@ -32,6 +33,17 @@ namespace Ichni.RhythmGame
substantialObject.FirstSetUpObject(isFirstGenerated);
substantialObject.SetEditorSubmodules();
if (isFirstGenerated) substantialObject.AfterInitialize();
// 在 NoteVisual 的 AfterInitialize + Recover 全部完成后,
// 立即强制父 Note 执行 ManualUpdate让效果状态机根据当前 songTime
// 将 noteMain 驱动至正确的可见状态,而非等待下一帧 NoteManager.ManualTick。
if (isFirstGenerated && substantialObject is NoteVisualBase noteVisual && noteVisual.note != null)
{
NoteBase note = noteVisual.note;
note.gameObject.SetActive(true);
note.ManualUpdate(EditorManager.instance.songInformation.songTime);
}
return substantialObject;
}

View File

@@ -206,6 +206,23 @@ namespace Ichni.RhythmGame
#endregion
#region [] Specific Manager Callbacks
/// <summary>
/// 当 NoteVisual 被动态挂载或替换后,重新缓存效果列表并刷新 NoteScheduler 注册。
/// 解决手动添加 NoteVisual 后,父 Note 的 generateEffects 等缓存仍为 null 导致特效无法驱动的问题。
/// </summary>
public void RefreshNoteVisualCaches()
{
generateEffects = GetEffectListSafe("Generate");
generalJudgeEffects = GetEffectListSafe("GeneralJudge");
perfectEffects = GetEffectListSafe("Perfect");
goodEffects = GetEffectListSafe("Good");
badEffects = GetEffectListSafe("Bad");
missEffects = GetEffectListSafe("Miss");
afterJudgeEffects = GetEffectListSafe("AfterJudge");
AddinNoteManager(false);
}
public void AddinNoteManager(bool isNewOne = true)
{
if (generateEffects != null)
@@ -243,15 +260,24 @@ namespace Ichni.RhythmGame
finishTime = Mathf.Max(finishTime, finishEffects[i].effectTime);
}
float activationTime = exactJudgeTime - beyondTime - 0.1f;
float endTime = (this is Hold hold ? hold.holdEndTime : exactJudgeTime) + finishTime + 0.1f;
if (exactJudgeTime - beyondTime - 0.5f > -EditorManager.instance.songInformation.delay)
{
gameObject.SetActive(false);
var noteScheduler = CoreServices.UpdateScheduler.NoteScheduler;
if (isNewOne)
noteScheduler.RegisterNote(this, exactJudgeTime - beyondTime - 0.1f, (this is Hold hold ? hold.holdEndTime : exactJudgeTime) + finishTime + 0.1f);
noteScheduler.RegisterNote(this, activationTime, endTime);
else
noteScheduler.ChangeNoteInfo(this, exactJudgeTime - beyondTime - 0.1f, (this is Hold hold ? hold.holdEndTime : exactJudgeTime) + finishTime + 0.1f);
noteScheduler.ChangeNoteInfo(this, activationTime, endTime);
}
else if (!isNewOne)
{
// 条件不满足(早期 Note时仍须更新 NoteManager 的时间窗口,
// 否则 beyondTime 变化后窗口不一致ManualTick 会错误地隐藏 Note。
var noteScheduler = CoreServices.UpdateScheduler.NoteScheduler;
noteScheduler.ChangeNoteInfo(this, activationTime, endTime);
}
}

View File

@@ -44,6 +44,20 @@ namespace Ichni.RhythmGame
base.SetDefaultSubmodules();
effectSubmodule = new EffectSubmodule(this, EffectSubmodule.EffectSubmodulePreset.Note);
}
/// <summary>
/// NoteVisual 初始化完毕后,通知父 Note 重新缓存效果列表。
/// 解决手动生成 NoteVisual 时,父 Note 的 generateEffects 等缓存为 null 导致特效不被驱动的问题。
/// </summary>
public override void AfterInitialize()
{
base.AfterInitialize();
if (note != null)
{
note.RefreshNoteVisualCaches();
}
}
#endregion
#region [] Visual Behaviors
@@ -56,6 +70,18 @@ namespace Ichni.RhythmGame
{
}
public override void OnDelete()
{
base.OnDelete();
// 清除父 Note 对已删除 NoteVisual 的引用,防止悬空引用和 NullReferenceException
if (note != null)
{
note.noteVisual = null;
note.RefreshNoteVisualCaches();
}
}
#endregion
}
}

View File

@@ -486,7 +486,7 @@
},{
"__type" : "Ichni.RhythmGame.Beatmap.CrossTrackPoint_BM,Assembly-CSharp",
"trackSwitch" : {
"value" : 5,
"value" : 2,
"animations" : [
{
"value" : 0,
@@ -510,7 +510,7 @@
]
},
"trackPercent" : {
"value" : 1,
"value" : 0.0704722852,
"animations" : [
{
"startValue" : 0,
@@ -551,8 +551,8 @@
}
],
"isSwitchingReturnType" : false,
"lastReturnType" : 3,
"returnType" : 3
"lastReturnType" : 1,
"returnType" : 1
},
"MotionAngles" : false,
"elementName" : "New Cross Track Point",
@@ -199799,6 +199799,477 @@
"attachedElementGuid" : {
"value" : "7ee5427a-b0a4-4323-a054-e593fa4388a9"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.Tap_BM,Assembly-CSharp",
"exactJudgeTime" : 4,
"elementName" : "New Tap",
"tags" : [
],
"elementGuid" : {
"value" : "06a02173-cb5a-4806-9659-02ab381a935e"
},
"attachedElementGuid" : {
"value" : "a4ca6cb1-3088-4a2b-9ed1-72d09b7c958c"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
"isOverridingDuration" : false,
"startTime" : -32767,
"endTime" : 32767,
"attachedElementGuid" : {
"value" : "06a02173-cb5a-4806-9659-02ab381a935e"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.NoteJudgeSubmodule_BM,Assembly-CSharp",
"judgeUnitList" : [
{
"__type" : "Ichni.RhythmGame.Beatmap.TouchAreaJudgeUnit_BM,Assembly-CSharp",
"areaRadius" : 600
}
],
"attachedElementGuid" : {
"value" : "06a02173-cb5a-4806-9659-02ab381a935e"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.NoteAudioSubmodule_BM,Assembly-CSharp",
"generalJudgeAudioList" : [
"DefaultTap"
],
"perfectAudioList" : [
],
"goodAudioList" : [
],
"badAudioList" : [
],
"missAudioList" : [
],
"holdStartAudioList" : [
],
"attachedElementGuid" : {
"value" : "06a02173-cb5a-4806-9659-02ab381a935e"
}
},{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteVisual_BM,Assembly-CSharp",
"isHighlighted" : false,
"themeBundleName" : "departure_to_multiverse",
"objectName" : "DTM_NoteVisualTap",
"elementName" : "New Note Visual",
"tags" : [
],
"elementGuid" : {
"value" : "71674887-7b2b-4b16-ab1d-dd2e36af2eb2"
},
"attachedElementGuid" : {
"value" : "06a02173-cb5a-4806-9659-02ab381a935e"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TransformSubmodule_BM,Assembly-CSharp",
"originalPosition" : {
"x" : 0,
"y" : 0,
"z" : 0
},
"originalEulerAngles" : {
"x" : 0,
"y" : 0,
"z" : 0
},
"originalScale" : {
"x" : 1,
"y" : 1,
"z" : 1
},
"attachedElementGuid" : {
"value" : "71674887-7b2b-4b16-ab1d-dd2e36af2eb2"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
"isOverridingDuration" : false,
"startTime" : -32767,
"endTime" : 32767,
"attachedElementGuid" : {
"value" : "71674887-7b2b-4b16-ab1d-dd2e36af2eb2"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.ColorSubmodule_BM,Assembly-CSharp",
"originalBaseColor" : {
"r" : 1,
"g" : 1,
"b" : 1,
"a" : 1
},
"emissionEnabled" : false,
"originalEmissionColor" : {
"r" : 0,
"g" : 0,
"b" : 0,
"a" : 1
},
"originalEmissionIntensity" : 0,
"attachedElementGuid" : {
"value" : "71674887-7b2b-4b16-ab1d-dd2e36af2eb2"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.EffectSubmodule_BM,Assembly-CSharp",
"effectCollection" : {"Generate":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteGenerateExpand_BM,Assembly-CSharp",
"generateTime" : 1,
"effectTime" : 0.2
}
],"GeneralJudge":[
],"StartHold":[
],"Holding":[
],"Perfect":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNotePerfectBurst_BM,Assembly-CSharp",
"effectTime" : 0
}
],"Good":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteGoodBurst_BM,Assembly-CSharp",
"effectTime" : 0
}
],"Bad":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteBadBurst_BM,Assembly-CSharp",
"effectTime" : 0
}
],"Miss":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteMissTransparent_BM,Assembly-CSharp",
"effectTime" : 0.2
}
],"AfterJudge":[
]
},
"attachedElementGuid" : {
"value" : "71674887-7b2b-4b16-ab1d-dd2e36af2eb2"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.Flick_BM,Assembly-CSharp",
"availableFlickDirections" : [
],
"exactJudgeTime" : 4.5,
"elementName" : "New Flick",
"tags" : [
],
"elementGuid" : {
"value" : "f394b21d-b7c4-44c6-96ea-5fc5c10d9e25"
},
"attachedElementGuid" : {
"value" : "a4ca6cb1-3088-4a2b-9ed1-72d09b7c958c"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
"isOverridingDuration" : false,
"startTime" : -32767,
"endTime" : 32767,
"attachedElementGuid" : {
"value" : "f394b21d-b7c4-44c6-96ea-5fc5c10d9e25"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.NoteJudgeSubmodule_BM,Assembly-CSharp",
"judgeUnitList" : [
{
"__type" : "Ichni.RhythmGame.Beatmap.TouchAreaJudgeUnit_BM,Assembly-CSharp",
"areaRadius" : 600
}
],
"attachedElementGuid" : {
"value" : "f394b21d-b7c4-44c6-96ea-5fc5c10d9e25"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.NoteAudioSubmodule_BM,Assembly-CSharp",
"generalJudgeAudioList" : [
"DefaultFlick"
],
"perfectAudioList" : [
],
"goodAudioList" : [
],
"badAudioList" : [
],
"missAudioList" : [
],
"holdStartAudioList" : [
],
"attachedElementGuid" : {
"value" : "f394b21d-b7c4-44c6-96ea-5fc5c10d9e25"
}
},{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteVisual_BM,Assembly-CSharp",
"isHighlighted" : false,
"themeBundleName" : "departure_to_multiverse",
"objectName" : "DTM_NoteVisualFlick",
"elementName" : "New Note Visual",
"tags" : [
],
"elementGuid" : {
"value" : "424dfc35-dee9-4d76-9f3d-854956cf3627"
},
"attachedElementGuid" : {
"value" : "f394b21d-b7c4-44c6-96ea-5fc5c10d9e25"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TransformSubmodule_BM,Assembly-CSharp",
"originalPosition" : {
"x" : 0,
"y" : 0,
"z" : 0
},
"originalEulerAngles" : {
"x" : 0,
"y" : 0,
"z" : 0
},
"originalScale" : {
"x" : 1,
"y" : 1,
"z" : 1
},
"attachedElementGuid" : {
"value" : "424dfc35-dee9-4d76-9f3d-854956cf3627"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
"isOverridingDuration" : false,
"startTime" : -32767,
"endTime" : 32767,
"attachedElementGuid" : {
"value" : "424dfc35-dee9-4d76-9f3d-854956cf3627"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.ColorSubmodule_BM,Assembly-CSharp",
"originalBaseColor" : {
"r" : 1,
"g" : 1,
"b" : 1,
"a" : 1
},
"emissionEnabled" : false,
"originalEmissionColor" : {
"r" : 0,
"g" : 0,
"b" : 0,
"a" : 1
},
"originalEmissionIntensity" : 0,
"attachedElementGuid" : {
"value" : "424dfc35-dee9-4d76-9f3d-854956cf3627"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.EffectSubmodule_BM,Assembly-CSharp",
"effectCollection" : {"Generate":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteGenerateExpand_BM,Assembly-CSharp",
"generateTime" : 0.5,
"effectTime" : 0.2
}
],"GeneralJudge":[
],"StartHold":[
],"Holding":[
],"Perfect":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNotePerfectBurst_BM,Assembly-CSharp",
"effectTime" : 0
}
],"Good":[
],"Bad":[
],"Miss":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteMissTransparent_BM,Assembly-CSharp",
"effectTime" : 0.2
}
],"AfterJudge":[
]
},
"attachedElementGuid" : {
"value" : "424dfc35-dee9-4d76-9f3d-854956cf3627"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.Tap_BM,Assembly-CSharp",
"exactJudgeTime" : 4.2,
"elementName" : "New Tap",
"tags" : [
],
"elementGuid" : {
"value" : "6fc9f259-6f80-482d-86c2-1f0705a47e8e"
},
"attachedElementGuid" : {
"value" : "a4ca6cb1-3088-4a2b-9ed1-72d09b7c958c"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
"isOverridingDuration" : false,
"startTime" : -32767,
"endTime" : 32767,
"attachedElementGuid" : {
"value" : "6fc9f259-6f80-482d-86c2-1f0705a47e8e"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.NoteJudgeSubmodule_BM,Assembly-CSharp",
"judgeUnitList" : [
{
"__type" : "Ichni.RhythmGame.Beatmap.TouchAreaJudgeUnit_BM,Assembly-CSharp",
"areaRadius" : 600
}
],
"attachedElementGuid" : {
"value" : "6fc9f259-6f80-482d-86c2-1f0705a47e8e"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.NoteAudioSubmodule_BM,Assembly-CSharp",
"generalJudgeAudioList" : [
"DefaultTap"
],
"perfectAudioList" : [
],
"goodAudioList" : [
],
"badAudioList" : [
],
"missAudioList" : [
],
"holdStartAudioList" : [
],
"attachedElementGuid" : {
"value" : "6fc9f259-6f80-482d-86c2-1f0705a47e8e"
}
},{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteVisual_BM,Assembly-CSharp",
"isHighlighted" : false,
"themeBundleName" : "departure_to_multiverse",
"objectName" : "DTM_NoteVisualTap",
"elementName" : "New Note Visual",
"tags" : [
],
"elementGuid" : {
"value" : "2f79b32f-e5e1-4ca3-b1aa-d70f3a41caee"
},
"attachedElementGuid" : {
"value" : "6fc9f259-6f80-482d-86c2-1f0705a47e8e"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TransformSubmodule_BM,Assembly-CSharp",
"originalPosition" : {
"x" : 0,
"y" : 0,
"z" : 0
},
"originalEulerAngles" : {
"x" : 0,
"y" : 0,
"z" : 0
},
"originalScale" : {
"x" : 1,
"y" : 1,
"z" : 1
},
"attachedElementGuid" : {
"value" : "2f79b32f-e5e1-4ca3-b1aa-d70f3a41caee"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
"isOverridingDuration" : false,
"startTime" : -32767,
"endTime" : 32767,
"attachedElementGuid" : {
"value" : "2f79b32f-e5e1-4ca3-b1aa-d70f3a41caee"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.ColorSubmodule_BM,Assembly-CSharp",
"originalBaseColor" : {
"r" : 1,
"g" : 1,
"b" : 1,
"a" : 1
},
"emissionEnabled" : false,
"originalEmissionColor" : {
"r" : 0,
"g" : 0,
"b" : 0,
"a" : 1
},
"originalEmissionIntensity" : 0,
"attachedElementGuid" : {
"value" : "2f79b32f-e5e1-4ca3-b1aa-d70f3a41caee"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.EffectSubmodule_BM,Assembly-CSharp",
"effectCollection" : {"Generate":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteGenerateExpand_BM,Assembly-CSharp",
"generateTime" : 1,
"effectTime" : 0.2
}
],"GeneralJudge":[
],"StartHold":[
],"Holding":[
],"Perfect":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNotePerfectBurst_BM,Assembly-CSharp",
"effectTime" : 0
}
],"Good":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteGoodBurst_BM,Assembly-CSharp",
"effectTime" : 0
}
],"Bad":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteBadBurst_BM,Assembly-CSharp",
"effectTime" : 0
}
],"Miss":[
{
"__type" : "Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse.Beatmap.DTMNoteMissTransparent_BM,Assembly-CSharp",
"effectTime" : 0.2
}
],"AfterJudge":[
]
},
"attachedElementGuid" : {
"value" : "2f79b32f-e5e1-4ca3-b1aa-d70f3a41caee"
}
}
],
"attachedElementGuid" : {

View File

@@ -6,7 +6,7 @@
"creatorName" : "U_Mora",
"editorVersion" : "0.1.0",
"createTime" : "2026\/1\/6 22:14:38",
"lastSaveTime" : "2026\/5\/29 20:18:32",
"lastSaveTime" : "6\/12\/2026 2:43:35 AM",
"selectedThemeBundleList" : [
"basic","departure_to_multiverse"
],

View File

@@ -10,14 +10,9 @@
"overrideReferences": false,
"precompiledReferences": [
"Newtonsoft.Json.dll",
"Microsoft.CSharp.dll",
"Microsoft.CodeAnalysis.dll",
"Microsoft.CodeAnalysis.CSharp.dll",
"System.Collections.Immutable.dll",
"System.Reflection.Metadata.dll",
"System.Runtime.CompilerServices.Unsafe.dll"
"Microsoft.CSharp.dll"
],
"autoReferenced": true,
"autoReferenced": false,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false

View File

@@ -14,7 +14,7 @@
"bezi3d"
],
"unity": "2018.3",
"version": "0.90.0",
"version": "0.92.1",
"type": "library",
"hideInEditor": false,
"dependencies": {