超大量的更新 修复很多问题,gameplay特效初步
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using System.Collections; // ���ֶ� Coroutine ��֧��
|
||||
using System.Collections; // Documentation text normalized.
|
||||
using System.Collections.Generic; // For List
|
||||
|
||||
public class AnimationController : MonoBehaviour
|
||||
@@ -9,11 +9,11 @@ public class AnimationController : MonoBehaviour
|
||||
|
||||
public static AnimationController Global;
|
||||
|
||||
public GameObject redEffect; // ��ɫ��������
|
||||
public GameObject greenEffect; // ��ɫ��������
|
||||
public GameObject yellowEffect; // ��ɫ��������
|
||||
public GameObject purpleEffect; // ��ɫ��������
|
||||
public GameObject blueEffect; // ��ɫ��������
|
||||
public GameObject redEffect; // Documentation text normalized.
|
||||
public GameObject greenEffect; // Documentation text normalized.
|
||||
public GameObject yellowEffect; // Documentation text normalized.
|
||||
public GameObject purpleEffect; // Documentation text normalized.
|
||||
public GameObject blueEffect; // Documentation text normalized.
|
||||
|
||||
private Animator redAnimator;
|
||||
private Animator greenAnimator;
|
||||
@@ -25,13 +25,13 @@ public class AnimationController : MonoBehaviour
|
||||
public GameObject hit_particular_object;
|
||||
public GameObject hit_ring_object;
|
||||
|
||||
[Header("�����ɫ (Hex Color Codes)")]
|
||||
[Header("Inspector")]
|
||||
public string redColorHex = "#FF9390";
|
||||
public string greenColorHex = "#38F6CA";
|
||||
public string yellowColorHex = "#FFE1A2";
|
||||
public string purpleColorHex = "#F083E4";
|
||||
public string blueColorHex = "#7AF9FF";
|
||||
[Header("Hold ��������")]
|
||||
[Header("Inspector")]
|
||||
public float holdParticleInterval = 0.2f;
|
||||
|
||||
private Coroutine holdParticleCoroutine;
|
||||
@@ -45,13 +45,13 @@ public class AnimationController : MonoBehaviour
|
||||
// Track active particle instances for immediate cleanup
|
||||
private List<GameObject> activeParticles = new List<GameObject>();
|
||||
|
||||
[Header("�ж�Ʈ��prefabs")]
|
||||
[Header("Inspector")]
|
||||
public GameObject perfect_judge_prefab;
|
||||
public GameObject great_judge_prefab;
|
||||
public GameObject good_judge_prefab;
|
||||
public GameObject miss_judge_prefab;
|
||||
[Header("�������������� (Legacy Text)")]
|
||||
// ���� Inspector �н���Ӧ�� UI Text ����
|
||||
[Header("Inspector")]
|
||||
// Documentation text normalized.
|
||||
public TextMeshProUGUI red_track_judgementText;
|
||||
public TextMeshProUGUI green_track_judgementText;
|
||||
public TextMeshProUGUI yellow_track_judgementText;
|
||||
@@ -223,11 +223,11 @@ public class AnimationController : MonoBehaviour
|
||||
case "blue": if (blueEffect != null) { spawnPos = blueEffect.transform.position; parentTransform = blueEffect.transform; } break;
|
||||
}
|
||||
|
||||
// ��ȡ��������ɫ
|
||||
// Documentation text normalized.
|
||||
Color trackColor;
|
||||
string hexCode = GetHexCodeForColor(color);
|
||||
|
||||
// ���Խ��� 16 ������ɫ���롣���ʧ�ܣ�ʹ�ð�ɫ��ΪĬ��ֵ��
|
||||
// Documentation text normalized.
|
||||
if (!ColorUtility.TryParseHtmlString(hexCode, out trackColor))
|
||||
{
|
||||
trackColor = Color.white;
|
||||
@@ -351,7 +351,7 @@ public class AnimationController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// ���ڸ�����ɫ���ƻ�ȡ��Ӧ�� 16 ���ƴ���
|
||||
// Documentation text normalized.
|
||||
private string GetHexCodeForColor(string color)
|
||||
{
|
||||
switch (color)
|
||||
@@ -361,7 +361,7 @@ public class AnimationController : MonoBehaviour
|
||||
case "yellow": return yellowColorHex;
|
||||
case "purple": return purpleColorHex;
|
||||
case "blue": return blueColorHex;
|
||||
default: return "#FFFFFF"; // Ĭ�Ϸ��ذ�ɫ
|
||||
default: return "#FFFFFF"; // Documentation text normalized.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,14 +408,14 @@ public class AnimationController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ���ݴ������ɫƵ������λ����Ӧ�� UI Text ����ȡ������
|
||||
/// Documentation text normalized.
|
||||
/// </summary>
|
||||
private void SpawnJudgePrefabByTrackText(string color)
|
||||
{
|
||||
TextMeshProUGUI targetText = null;
|
||||
Transform spawnPoint = null;
|
||||
|
||||
// 1. ƥ���Ӧ���ı������λ��
|
||||
// Documentation text normalized.
|
||||
switch (color)
|
||||
{
|
||||
case "red": targetText = red_track_judgementText; spawnPoint = redEffect != null ? redEffect.transform : null; break;
|
||||
@@ -426,11 +426,11 @@ public class AnimationController : MonoBehaviour
|
||||
}
|
||||
if (targetText != null && spawnPoint != null)
|
||||
{
|
||||
// 打印调试信息,确认判定到底读取到的是什么文字
|
||||
if (JudgeManager.IsDebugEnabled) Debug.Log($"判定 {color} 当前读取到的文字为: [{targetText.text}]");
|
||||
// Documentation text normalized.
|
||||
if (JudgeManager.IsDebugEnabled) Debug.Log($"判定 {color} 当前读取到的文字为 [{targetText.text}]");
|
||||
}
|
||||
|
||||
// 2. ����ҵ����ı����ı���Ϊ�գ���ִ�������
|
||||
// Documentation text normalized.
|
||||
if (targetText != null && spawnPoint != null && !string.IsNullOrEmpty(targetText.text))
|
||||
{
|
||||
DoExecutePrefabSpawn(targetText.text, spawnPoint);
|
||||
@@ -438,13 +438,13 @@ public class AnimationController : MonoBehaviour
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ����ִ��ʵ�����ĺ���
|
||||
/// Documentation text normalized.
|
||||
/// </summary>
|
||||
private void DoExecutePrefabSpawn(string judgeResult, Transform spawnTransform)
|
||||
{
|
||||
GameObject prefabToUse = null;
|
||||
|
||||
// �ַ���ƥ�䣨��ȷ���� InputManager �д�����ַ���һ�£�
|
||||
// Documentation text normalized.
|
||||
if (judgeResult.Contains("Perfect")) prefabToUse = perfect_judge_prefab;
|
||||
else if (judgeResult.Contains("Great")) prefabToUse = great_judge_prefab;
|
||||
else if (judgeResult.Contains("Good")) prefabToUse = good_judge_prefab;
|
||||
@@ -452,10 +452,10 @@ public class AnimationController : MonoBehaviour
|
||||
|
||||
if (prefabToUse != null)
|
||||
{
|
||||
// �ڶ�Ӧ��Ч�������ж� Prefab
|
||||
// Documentation text normalized.
|
||||
GameObject instance = Instantiate(prefabToUse, spawnTransform.position, Quaternion.identity);
|
||||
|
||||
// �Զ����٣���ֹ�ѻ�
|
||||
// Documentation text normalized.
|
||||
Destroy(instance, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user