基础内容-4

Tap,Stay,Flick基础构造
This commit is contained in:
SoulliesOfficial
2025-01-28 11:58:39 -05:00
parent 70d06c6334
commit 552651efbc
14 changed files with 269 additions and 78 deletions

View File

@@ -1,18 +1,46 @@
using System.Collections;
using System.Collections.Generic;
using Lean.Pool;
using UnityEngine;
public class Stay : MonoBehaviour
namespace Ichni.RhythmGame
{
// Start is called before the first frame update
void Start()
public class Stay : NoteBase
{
}
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.SetParent(attach);
if (attach.TryGetComponent(out Track track))
{
if (track.trackTimeSubmodule != null)
{
stay.track = track;
stay.trackPositioner.spline = track.trackPathSubmodule.path;
stay.isOnTrack = true;
stay.UpdateNoteInTrack();
}
else
{
throw new System.Exception("如果Note要生成在Track上Track必须有TrackTimeSubmodule组件。");
}
}
else
{
}
// Update is called once per frame
void Update()
{
return stay;
}
public void NewInitialize(string elementName, float exactJudgeTime)
{
base.NewInitialize(elementName);
this.exactJudgeTime = exactJudgeTime;
this.track = null;
this.isOnTrack = false;
}
}
}
}