技能主要更新,修复卡顿并加入动画,以及各种其他更新。
This commit is contained in:
@@ -2,14 +2,14 @@ using UnityEngine;
|
||||
|
||||
public class Notes : MonoBehaviour
|
||||
{
|
||||
public int trackIndex; // 轨道索引
|
||||
public float hitTime; // 该音符应该被击中的时间
|
||||
private bool canBeJudged = false; // 是否进入判定区域
|
||||
private bool isHit = false; // 是否已被击中
|
||||
public int trackIndex; // �������
|
||||
public float hitTime; // ������Ӧ�ñ����е�ʱ��
|
||||
private bool canBeJudged = false; // �Ƿ�����ж�����
|
||||
private bool isHit = false; // �Ƿ��ѱ�����
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// 只有进入判定区后,才允许自动miss
|
||||
// ֻ�н����ж����������Զ�miss
|
||||
if (canBeJudged && !isHit && Time.timeSinceLevelLoad > hitTime + 0.3f)
|
||||
{
|
||||
JudgeMiss();
|
||||
@@ -34,7 +34,7 @@ public class Notes : MonoBehaviour
|
||||
|
||||
public void JudgeNote()
|
||||
{
|
||||
if (!canBeJudged || isHit) return; // 仅在进入判定区后才能被判定
|
||||
if (!canBeJudged || isHit) return; // ���ڽ����ж�������ܱ��ж�
|
||||
|
||||
float currentTime = Time.timeSinceLevelLoad;
|
||||
float timeDifference = Mathf.Abs(currentTime - hitTime);
|
||||
@@ -59,10 +59,10 @@ public class Notes : MonoBehaviour
|
||||
|
||||
private void Recycle()
|
||||
{
|
||||
// 如果存在 NotePool,优先归还池,否则销毁物体
|
||||
// ������� NotePool�����ȹ黹�أ�������������
|
||||
if (NotePool.Instance != null)
|
||||
{
|
||||
NotePool.Instance.ReturnNote(gameObject, "red"); // color 未保存时默认 red,建议上层调用时传入
|
||||
NotePool.Instance.ReturnNote(gameObject, "red"); // color δ����ʱĬ�� red�������ϲ����ʱ����
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user