This commit is contained in:
2025-07-14 16:46:49 +08:00
18 changed files with 16359 additions and 16326 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 6dbdd314784e80440b48088e6357c1ef
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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);
}
}
}
}

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

@@ -1,8 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
using UniRx;
using UnityEngine;
@@ -13,10 +11,10 @@ namespace Ichni.RhythmGame
public class BeatmapContainer : IBaseElement
{
public List<GameElement> gameElementList;
[NonSerialized]
public List<UnityAction> lowPriorityActions;
public BaseElement_BM matchedBM { get; set; }
public BeatmapContainer()
@@ -25,7 +23,7 @@ namespace Ichni.RhythmGame
lowPriorityActions = new List<UnityAction>();
Observable.EveryUpdate().Subscribe(_ => ExecuteLowPriorityActions());
}
public void ExecuteLowPriorityActions()
{
if (lowPriorityActions.Count > 0)
@@ -38,12 +36,11 @@ namespace Ichni.RhythmGame
public void SaveBM()
{
matchedBM = new BeatmapContainer_BM(gameElementList);
}
public void SetUpInspector()
{
return;
throw new System.NotImplementedException();
}
public void Refresh()
@@ -57,7 +54,7 @@ namespace Ichni.RhythmGame
public partial class BeatmapContainer_BM : BaseElement_BM
{
public List<BaseElement_BM> elementList;
public BeatmapContainer_BM()
{
@@ -67,7 +64,7 @@ namespace Ichni.RhythmGame
public BeatmapContainer_BM(List<GameElement> gameElementList)
{
elementList = new List<BaseElement_BM>();
gameElementList.ForEach(e =>
{
e.SaveBM();
@@ -93,23 +90,20 @@ namespace Ichni.RhythmGame
EditorManager.instance.beatmapContainer = new BeatmapContainer();
EditorManager.instance.beatmapContainer.matchedBM = this;
GameElement_BM.identifier.Clear();
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);
@@ -123,7 +117,6 @@ namespace Ichni.RhythmGame
if (element == null)
{
Debug.LogError("Null element detected in elementList during low-priority execution. Skipping execution.");
return;
}
@@ -132,7 +125,7 @@ namespace Ichni.RhythmGame
element.ExecuteBM();
}
});
EditorManager.instance.beatmapContainer.ExecuteLowPriorityActions();
}
}
@@ -141,10 +134,9 @@ namespace Ichni.RhythmGame
{
public static readonly List<Type> LowPriorityGameElementTypes = new()
{
typeof(NoteJudgeSubmodule_BM),
typeof(LookAt_BM),
//typeof(NoteJudgeSubmodule_BM),
};
public static readonly List<Type> LowPriorityDataTypes = new()
{
typeof(EnableControlEffect_BM),

View File

@@ -86,7 +86,7 @@ namespace Ichni.RhythmGame
/// </summary>
public virtual void AfterInitialize()
{
//SetEditorSubmodules();
matchedBM?.AfterExecute();
}
/// <summary>

View File

@@ -121,7 +121,6 @@ namespace Ichni
beatmapContainer.gameElementList.ForEach(gameElement =>
{
gameElement.AfterInitialize();
gameElement.Refresh();
});
}

View File

@@ -1861,6 +1861,9 @@
"value" : "7e1f2e2d-1e13-4ad9-b14f-1cca01476469"
}
}
],
"lowPriorityElementList" : [
],
"attachedElementGuid" : {
"value" : "00000000-0000-0000-0000-000000000000"