基础内容-6
技术性调整; Note效果;
This commit is contained in:
@@ -14,30 +14,23 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public static Track GenerateElement(string elementName, BaseElement parent, Vector3 position)
|
||||
{
|
||||
if (parent == null)
|
||||
{
|
||||
throw new System.Exception("Parent is null");
|
||||
}
|
||||
Track track = Instantiate(EditorManager.instance.basePrefabs.track, parent.transform).GetComponent<Track>();
|
||||
|
||||
Track track = LeanPool.Spawn(EditorManager.instance.basePrefabs.track, parent.transform).GetComponent<Track>();
|
||||
|
||||
track.NewInitialize(elementName, position);
|
||||
track.Initialize(elementName);
|
||||
track.SetParent(parent);
|
||||
|
||||
track.transformSubmodule = new TransformSubmodule(track, position, Vector3.zero, Vector3.one);
|
||||
track.timeDurationSubmodule = new TimeDurationSubmodule(track);
|
||||
|
||||
track.trackPathSubmodule = null;
|
||||
track.trackTimeSubmodule = null;
|
||||
track.trackRendererSubmodule = null;
|
||||
|
||||
track.SetTransformObserver();
|
||||
|
||||
return track;
|
||||
}
|
||||
|
||||
private void NewInitialize(string elementName, Vector3 position)
|
||||
{
|
||||
base.NewInitialize(elementName);
|
||||
timeDurationSubmodule = new TimeDurationSubmodule();
|
||||
transformSubmodule = new TransformSubmodule(position, Vector3.zero, Vector3.one);
|
||||
trackPathSubmodule = null;
|
||||
trackTimeSubmodule = null;
|
||||
trackRendererSubmodule = null;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
|
||||
@@ -56,7 +49,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public override void Refresh()
|
||||
{
|
||||
transform.localPosition = transformSubmodule.currentPosition;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user