大活:Tracker和Interferometer
等待改进 Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Beatmap;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
@@ -9,7 +10,7 @@ using UnityEngine.Events;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class BeatmapContainer : IBaseElement
|
||||
public class BeatmapContainer : IBaseElement, IBeChangeInExport
|
||||
{
|
||||
public List<GameElement> gameElementList;
|
||||
|
||||
@@ -17,6 +18,7 @@ namespace Ichni.RhythmGame
|
||||
public List<UnityAction> lowPriorityActions;
|
||||
|
||||
public BaseElement_BM matchedBM { get; set; }
|
||||
public BaseElement_BM MatchingExportElement { get; set; }
|
||||
|
||||
public BeatmapContainer()
|
||||
{
|
||||
@@ -72,6 +74,15 @@ namespace Ichni.RhythmGame
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void SaveExportBM()
|
||||
{
|
||||
MatchingExportElement = new BeatmapContainer_BM(gameElementList, true);
|
||||
if (((BeatmapContainer_BM)MatchingExportElement).elementList.Any(i => i is ICanNotInExport))
|
||||
{
|
||||
Debug.LogError("Export Error!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
@@ -86,7 +97,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
}
|
||||
|
||||
public BeatmapContainer_BM(List<GameElement> gameElementList)
|
||||
public BeatmapContainer_BM(List<GameElement> gameElementList, bool forExport = false)
|
||||
{
|
||||
elementList = new List<BaseElement_BM>();
|
||||
|
||||
@@ -95,18 +106,39 @@ namespace Ichni.RhythmGame
|
||||
e.SaveBM();
|
||||
e.submoduleList.RemoveAll(s => s == null);
|
||||
e.submoduleList.ForEach(s => s.SaveBM());
|
||||
if (forExport && e is IBeChangeInExport changeInExport)
|
||||
{
|
||||
changeInExport.SaveExportBM();
|
||||
}
|
||||
});
|
||||
|
||||
foreach (var gameElement in gameElementList)
|
||||
{
|
||||
if (gameElement.matchedBM != null)
|
||||
{
|
||||
elementList.Add(gameElement.matchedBM);
|
||||
}
|
||||
if (forExport && gameElement is IBeChangeInExport changeInExport)
|
||||
{
|
||||
if (changeInExport.MatchingExportElement != null)
|
||||
{
|
||||
elementList.Add(changeInExport.MatchingExportElement);
|
||||
List<BaseElement_BM> submodules = gameElement.submoduleList.ConvertAll(s => s.matchedBM);
|
||||
submodules.RemoveAll(s => s == null);
|
||||
submodules.ForEach(e => { e.attachedElementGuid = ((GameElement_BM)changeInExport.MatchingExportElement).elementGuid; });
|
||||
elementList.AddRange(submodules);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elementList.Add(gameElement.matchedBM);
|
||||
List<BaseElement_BM> submodules = gameElement.submoduleList.ConvertAll(s => s.matchedBM);
|
||||
submodules.RemoveAll(s => s == null);
|
||||
elementList.AddRange(submodules);
|
||||
}
|
||||
|
||||
List<BaseElement_BM> submodules = gameElement.submoduleList.ConvertAll(s => s.matchedBM);
|
||||
submodules.RemoveAll(s => s == null);
|
||||
elementList.AddRange(submodules);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user