基础内容-6
技术性调整; Note效果;
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Dreamteck.Splines;
|
||||
using Lean.Pool;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
@@ -9,8 +11,11 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public static Stay GenerateElement(string elementName, float exactJudgeTime, BaseElement attach)
|
||||
{
|
||||
Stay stay = LeanPool.Spawn(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Stay>();
|
||||
stay.NewInitialize(elementName, exactJudgeTime);
|
||||
Stay stay = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Stay>();
|
||||
stay.Initialize(elementName);
|
||||
stay.exactJudgeTime = exactJudgeTime;
|
||||
stay.transformSubmodule = new TransformSubmodule(stay);
|
||||
stay.timeDurationSubmodule = new TimeDurationSubmodule(stay);
|
||||
stay.SetParent(attach);
|
||||
|
||||
if (attach.TryGetComponent(out Track track))
|
||||
@@ -18,6 +23,7 @@ namespace Ichni.RhythmGame
|
||||
if (track.trackTimeSubmodule != null)
|
||||
{
|
||||
stay.track = track;
|
||||
stay.trackPositioner = stay.AddComponent<SplinePositioner>();
|
||||
stay.trackPositioner.spline = track.trackPathSubmodule.path;
|
||||
stay.isOnTrack = true;
|
||||
stay.UpdateNoteInTrack();
|
||||
@@ -29,18 +35,11 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
stay.track = null;
|
||||
stay.isOnTrack = false;
|
||||
}
|
||||
|
||||
return stay;
|
||||
}
|
||||
|
||||
public void NewInitialize(string elementName, float exactJudgeTime)
|
||||
{
|
||||
base.NewInitialize(elementName);
|
||||
this.exactJudgeTime = exactJudgeTime;
|
||||
this.track = null;
|
||||
this.isOnTrack = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user