架构重新设计

基本重做了所有物体和次级模块代码
This commit is contained in:
SoulliesOfficial
2025-02-08 02:31:39 -05:00
parent 752c9b73e3
commit 7ab738cb68
44 changed files with 1320 additions and 847 deletions

View File

@@ -13,30 +13,29 @@ namespace Ichni.RhythmGame
public TrackTimeSubmoduleStatic targetTrackTimeSubmoduleStatic;
public static TrackTotalTimeChange GenerateElement(string elementName, Guid id,
List<string> tags, Track targetTrack, FlexibleFloat totalTime)
List<string> tags, bool isFirstGenerated, Track animatedTrack, FlexibleFloat totalTime)
{
TrackTotalTimeChange trackTotalTimeChange = Instantiate(EditorManager.instance.basePrefabs.emptyObject)
.AddComponent<TrackTotalTimeChange>();
trackTotalTimeChange.Initialize(elementName, id, tags);
trackTotalTimeChange.Initialize(elementName, id, tags, isFirstGenerated);
trackTotalTimeChange.targetObject = targetTrack;
trackTotalTimeChange.animatedObject = animatedTrack;
if (targetTrack.trackTimeSubmodule is TrackTimeSubmoduleStatic submoduleStatic)
{
trackTotalTimeChange.targetTrackTimeSubmoduleStatic = submoduleStatic;
}
else
{
throw new System.Exception("Target object does not have a TrackTimeSubmoduleStatic");
}
trackTotalTimeChange.targetTrackTimeSubmoduleStatic = animatedTrack.trackTimeSubmodule as TrackTimeSubmoduleStatic;
trackTotalTimeChange.totalTime = totalTime;
trackTotalTimeChange.animationReturnType = FlexibleReturnType.Before;
trackTotalTimeChange.timeDurationSubmodule.SetDuration(totalTime);
//trackTotalTimeChange.timeDurationSubmodule.SetDuration(totalTime);
trackTotalTimeChange.SetParent(targetTrack);
trackTotalTimeChange.SetParent(animatedTrack);
return trackTotalTimeChange;
}
protected override void SetDefaultSubmodules()
{
timeDurationSubmodule = new TimeDurationSubmodule(this);
submoduleList.Add(timeDurationSubmodule);
}
protected override void UpdateAnimation(float songTime)
{
@@ -53,13 +52,13 @@ namespace Ichni.RhythmGame
{
public override void SaveBM()
{
matchedBM = new TrackTotalTimeChange_BM(elementName, elementGuid, tags, targetObject.matchedBM as Track_BM, totalTime.ConvertToBM());
matchedBM = new TrackTotalTimeChange_BM(elementName, elementGuid, tags, animatedObject.matchedBM as Track_BM, totalTime.ConvertToBM());
}
}
namespace Beatmap
{
public class TrackTotalTimeChange_BM : BaseElement_BM
public class TrackTotalTimeChange_BM : GameElement_BM
{
public FlexibleFloat_BM totalTime;
@@ -69,22 +68,22 @@ namespace Ichni.RhythmGame
}
public TrackTotalTimeChange_BM(string elementName, Guid elementGuid, List<string> tags,
BaseElement_BM attachedElement, FlexibleFloat_BM totalTime) : base(elementName, elementGuid, tags,
attachedElement)
GameElement_BM attachedElement, FlexibleFloat_BM totalTime) :
base(elementName, elementGuid, tags, attachedElement)
{
this.totalTime = totalTime;
}
public override void ExecuteBM()
{
TrackTotalTimeChange.GenerateElement(elementName, elementGuid, tags,
TrackTotalTimeChange.GenerateElement(elementName, elementGuid, tags, false,
GetElement(attachedElementGuid) as Track, totalTime.ConvertToGameType());
}
public override BaseElement DuplicateBM(BaseElement parent)
public override GameElement DuplicateBM(GameElement parent)
{
return TrackTotalTimeChange.GenerateElement(elementName, elementGuid, tags, parent as Track,
totalTime.ConvertToGameType());
return TrackTotalTimeChange.GenerateElement(elementName, elementGuid, tags, false,
parent as Track, totalTime.ConvertToGameType());
}
}
}