基础内容-4
Tap,Stay,Flick基础构造
This commit is contained in:
@@ -1,18 +1,46 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Lean.Pool;
|
||||
using UnityEngine;
|
||||
|
||||
public class Tap : MonoBehaviour
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
public class Tap : NoteBase
|
||||
{
|
||||
|
||||
}
|
||||
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.SetParent(attach);
|
||||
|
||||
if (attach.TryGetComponent(out Track track))
|
||||
{
|
||||
if (track.trackTimeSubmodule != null)
|
||||
{
|
||||
tap.track = track;
|
||||
tap.trackPositioner.spline = track.trackPathSubmodule.path;
|
||||
tap.isOnTrack = true;
|
||||
tap.UpdateNoteInTrack();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new System.Exception("如果Note要生成在Track上,Track必须有TrackTimeSubmodule组件。");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
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