基础内容-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 Tap GenerateElement(string elementName, float exactJudgeTime, BaseElement attach)
|
||||
{
|
||||
Tap tap = LeanPool.Spawn(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Tap>();
|
||||
tap.NewInitialize(elementName, exactJudgeTime);
|
||||
Tap tap = Instantiate(EditorManager.instance.basePrefabs.tapNote, attach.transform).GetComponent<Tap>();
|
||||
tap.Initialize(elementName);
|
||||
tap.exactJudgeTime = exactJudgeTime;
|
||||
tap.transformSubmodule = new TransformSubmodule(tap);
|
||||
tap.timeDurationSubmodule = new TimeDurationSubmodule(tap);
|
||||
tap.SetParent(attach);
|
||||
|
||||
if (attach.TryGetComponent(out Track track))
|
||||
@@ -18,6 +23,7 @@ namespace Ichni.RhythmGame
|
||||
if (track.trackTimeSubmodule != null)
|
||||
{
|
||||
tap.track = track;
|
||||
tap.trackPositioner = tap.AddComponent<SplinePositioner>();
|
||||
tap.trackPositioner.spline = track.trackPathSubmodule.path;
|
||||
tap.isOnTrack = true;
|
||||
tap.UpdateNoteInTrack();
|
||||
@@ -29,18 +35,11 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
tap.track = null;
|
||||
tap.isOnTrack = false;
|
||||
}
|
||||
|
||||
return tap;
|
||||
}
|
||||
|
||||
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