架构重新设计
基本重做了所有物体和次级模块代码
This commit is contained in:
@@ -7,25 +7,32 @@ using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public partial class ElementFolder : BaseElement
|
||||
public partial class ElementFolder : GameElement, IHaveTransformSubmodule, IHaveTimeDurationSubmodule
|
||||
{
|
||||
public List<Track> trackList;
|
||||
public TransformSubmodule transformSubmodule { get; set; }
|
||||
public TimeDurationSubmodule timeDurationSubmodule { get; set; }
|
||||
|
||||
public static ElementFolder GenerateElement(string name, Guid id, List<string> tags, BaseElement parentElement)
|
||||
public static ElementFolder GenerateElement(string name, Guid id, List<string> tags, bool isFirstGenerated, GameElement parentElement)
|
||||
{
|
||||
ElementFolder elementFolder = Instantiate(EditorManager.instance.basePrefabs.elementFolder).GetComponent<ElementFolder>();
|
||||
|
||||
elementFolder.Initialize(name, id, tags);
|
||||
elementFolder.Initialize(name, id, tags, isFirstGenerated);
|
||||
elementFolder.SetParent(parentElement);
|
||||
|
||||
elementFolder.transformSubmodule = new TransformSubmodule(elementFolder);
|
||||
elementFolder.timeDurationSubmodule = new TimeDurationSubmodule(elementFolder);
|
||||
//elementFolder.GenerateTab(parentElement);
|
||||
|
||||
elementFolder.SetTransformObserver();
|
||||
|
||||
return elementFolder;
|
||||
}
|
||||
|
||||
protected override void SetDefaultSubmodules()
|
||||
{
|
||||
transformSubmodule = new TransformSubmodule(this);
|
||||
timeDurationSubmodule = new TimeDurationSubmodule(this);
|
||||
|
||||
submoduleList.Add(transformSubmodule);
|
||||
submoduleList.Add(timeDurationSubmodule);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class ElementFolder
|
||||
@@ -33,21 +40,21 @@ namespace Ichni.RhythmGame
|
||||
public override void SaveBM()
|
||||
{
|
||||
matchedBM = parentElement != null ?
|
||||
new ElementFolder_BM(elementName, elementGuid, tags, parentElement.matchedBM) :
|
||||
new ElementFolder_BM(elementName, elementGuid, tags, parentElement.matchedBM as GameElement_BM) :
|
||||
new ElementFolder_BM(elementName, elementGuid, tags, null);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class ElementFolder_BM : BaseElement_BM
|
||||
public class ElementFolder_BM : GameElement_BM
|
||||
{
|
||||
public ElementFolder_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ElementFolder_BM(string elementName, Guid elementGuid, List<string> tags, BaseElement_BM attachedElement)
|
||||
public ElementFolder_BM(string elementName, Guid elementGuid, List<string> tags, GameElement_BM attachedElement)
|
||||
: base(elementName, elementGuid, tags, attachedElement)
|
||||
{
|
||||
|
||||
@@ -55,12 +62,12 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
matchedElement = ElementFolder.GenerateElement(elementName, elementGuid, tags, GetElement(attachedElementGuid));
|
||||
matchedElement = ElementFolder.GenerateElement(elementName, elementGuid, tags,false, GetElement(attachedElementGuid));
|
||||
}
|
||||
|
||||
public override BaseElement DuplicateBM(BaseElement parent)
|
||||
public override GameElement DuplicateBM(GameElement parent)
|
||||
{
|
||||
return ElementFolder.GenerateElement(elementName, elementGuid, tags, parent);
|
||||
return ElementFolder.GenerateElement(elementName, elementGuid, tags, false, parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user