架构重新设计
基本重做了所有物体和次级模块代码
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Dreamteck.Splines;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
@@ -10,17 +11,17 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public partial class Stay : NoteBase
|
||||
{
|
||||
public static Stay GenerateElement(string elementName, Guid id, List<string> tags,
|
||||
float exactJudgeTime, BaseElement attach)
|
||||
public static Stay GenerateElement(string elementName, Guid id, List<string> tags, bool isFirstGenerated,
|
||||
GameElement parentElement, float exactJudgeTime)
|
||||
{
|
||||
Stay stay = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Stay>();
|
||||
stay.Initialize(elementName, id, tags);
|
||||
Stay stay = Instantiate(EditorManager.instance.basePrefabs.tapNote, parentElement.transform).GetComponent<Stay>();
|
||||
stay.Initialize(elementName, id, tags, isFirstGenerated);
|
||||
stay.exactJudgeTime = exactJudgeTime;
|
||||
stay.transformSubmodule = new TransformSubmodule(stay);
|
||||
stay.timeDurationSubmodule = new TimeDurationSubmodule(stay);
|
||||
stay.SetParent(attach);
|
||||
stay.SetParent(parentElement);
|
||||
|
||||
if (attach.TryGetComponent(out Track track))
|
||||
if (parentElement.TryGetComponent(out Track track))
|
||||
{
|
||||
if (track.trackTimeSubmodule != null)
|
||||
{
|
||||
@@ -49,35 +50,33 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = new Beatmap.Stay_BM(elementName, elementGuid, tags, parentElement.matchedBM, exactJudgeTime);
|
||||
matchedBM = new Stay_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM, exactJudgeTime);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class Stay_BM : BaseElement_BM
|
||||
public class Stay_BM : NoteBase_BM
|
||||
{
|
||||
public float exactJudgeTime;
|
||||
|
||||
public Stay_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Stay_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement, float exactJudgeTime)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
public Stay_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement, float exactJudgeTime)
|
||||
: base(elementName, elementGuid, tags, attachedElement, exactJudgeTime)
|
||||
{
|
||||
this.exactJudgeTime = exactJudgeTime;
|
||||
}
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = Stay.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, GetElement(attachedElementGuid));
|
||||
matchedElement = Stay.GenerateElement(elementName, elementGuid, tags, false, GetElement(attachedElementGuid), exactJudgeTime);
|
||||
}
|
||||
|
||||
public override BaseElement DuplicateBM(BaseElement parent)
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return Stay.GenerateElement(elementName, elementGuid, tags, exactJudgeTime, parent);
|
||||
return Stay.GenerateElement(elementName, elementGuid, tags, false, parent, exactJudgeTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user