超大量的更新 修复很多问题,gameplay特效初步

This commit is contained in:
FloatGaming
2026-02-14 23:46:20 +08:00
parent ef8eb67259
commit 3a7a0b4669
360 changed files with 85670 additions and 4144 deletions
@@ -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);
}
}