AfterInitialize调整
This commit is contained in:
@@ -149,6 +149,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
matchedElement = LookAt.GenerateElement(elementName, elementGuid, tags, false,
|
||||
GetElement(attachedElementGuid), GetElement(lookAtObjectGuid), enabling.ConvertToGameType());
|
||||
matchedElement.matchedBM = this;
|
||||
}
|
||||
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
@@ -156,6 +157,11 @@ namespace Ichni.RhythmGame
|
||||
return LookAt.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent,
|
||||
GetElement(lookAtObjectGuid), enabling.ConvertToGameType());
|
||||
}
|
||||
|
||||
public override void AfterExecute()
|
||||
{
|
||||
(matchedElement as LookAt).lookAtObject = GetElement(lookAtObjectGuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Ichni.RhythmGame
|
||||
/// </summary>
|
||||
public virtual void AfterInitialize()
|
||||
{
|
||||
//SetEditorSubmodules();
|
||||
matchedBM?.AfterExecute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -121,7 +121,6 @@ namespace Ichni
|
||||
beatmapContainer.gameElementList.ForEach(gameElement =>
|
||||
{
|
||||
gameElement.AfterInitialize();
|
||||
|
||||
gameElement.Refresh();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user