Merge branch 'main' of https://github.com/MiracleForest-Ichni/IchniCreatorStudio
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user