AfterInitialize调整

This commit is contained in:
SoulliesOfficial
2025-07-14 04:22:50 -04:00
parent 81ac6de8dc
commit 3eedadd139
20 changed files with 63720 additions and 16256 deletions

View File

@@ -52,19 +52,6 @@ namespace Ichni.RhythmGame
}
}
// public virtual void SetTimeDuration()
// {
//
// }
//
// public void ApplyTimeDuration()
// {
// childElementList.ForEach(x => x.ApplyTimeDuration());
// timeDurationSubmodule?.SetDurationFromChildren(
// childElementList.Select(x => x.timeDurationSubmodule).ToList());
// }
//
public interface IHaveInteraction
{
public void TriggerInteraction();
@@ -81,6 +68,15 @@ namespace Ichni.RhythmGame
/// 从存档类中生成游戏物体
/// </summary>
public abstract void ExecuteBM();
/// <summary>
/// 在AfterInitialize中被调用用于处理GameElement的“需要引用”的物体在此物体后面生成的情况。
/// 注意如果使用此函数需要在ExecuteBM中设置 matchedElement.matchedBM = this;
/// </summary>
public virtual void AfterExecute()
{
}
}
}
}

View File

@@ -60,15 +60,14 @@ namespace Ichni.RhythmGame
{
(EditorManager.instance.beatmapContainer).lowPriorityActions.Add(() =>
{
var a = effectBM.ConvertToGameType(attachedGameElement);
EffectBase a = effectBM.ConvertToGameType(attachedGameElement);
effectList.Add(a);
a.AccommodatingList = effectList;
});
}
else
{
var a = effectBM.ConvertToGameType(attachedGameElement);
EffectBase a = effectBM.ConvertToGameType(attachedGameElement);
effectList.Add(a);
a.AccommodatingList = effectList;
}

View File

@@ -93,20 +93,17 @@ namespace Ichni.RhythmGame
elementList.ForEach(element =>
{
//#if UNITY_EDITOR
if (element == null)
{
Debug.LogError("Null element detected in elementList. Skipping execution.");
return;
}
//Debug.Log(element.GetType());
if (LowPriorityGameElementTypes.Contains(element.GetType()))
{
return;
}
//#endif
if (element is GameElement_BM gameElement)
{
GameElement_BM.identifier.Add(gameElement.elementGuid, gameElement);
@@ -120,7 +117,6 @@ namespace Ichni.RhythmGame
if (element == null)
{
Debug.LogError("Null element detected in elementList during low-priority execution. Skipping execution.");
return;
}
@@ -129,7 +125,7 @@ namespace Ichni.RhythmGame
element.ExecuteBM();
}
});
EditorManager.instance.beatmapContainer.ExecuteLowPriorityActions();
}
}
@@ -138,7 +134,7 @@ namespace Ichni.RhythmGame
{
public static readonly List<Type> LowPriorityGameElementTypes = new()
{
typeof(NoteJudgeSubmodule_BM),
//typeof(NoteJudgeSubmodule_BM),
};
public static readonly List<Type> LowPriorityDataTypes = new()