同步
This commit is contained in:
@@ -47,6 +47,19 @@ namespace Ichni.RhythmGame
|
||||
base.SetDefaultSubmodules();
|
||||
effectSubmodule = new EffectSubmodule(this, EffectSubmodule.EffectSubmodulePreset.Note);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// NoteVisual 初始化完毕后,通知父 Note 重新缓存效果列表。
|
||||
/// </summary>
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
base.AfterInitialize();
|
||||
|
||||
if (note != null)
|
||||
{
|
||||
note.RefreshNoteVisualCaches();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region [行为重写] Behavior Overrides
|
||||
@@ -59,6 +72,18 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
|
||||
// 清除父 Note 对已删除 NoteVisual 的引用,防止悬空引用和 NullReferenceException
|
||||
if (note != null)
|
||||
{
|
||||
note.noteVisual = null;
|
||||
note.RefreshNoteVisualCaches();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user