超大量的更新 修复很多问题,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,37 +1,37 @@
using UnityEngine;
using UnityEngine;
using System.Collections;
public class Animation_GenerateJudgementSituationPrefab : MonoBehaviour
{
public static Animation_GenerateJudgementSituationPrefab Instance;
[Header("λ ()")]
[Header("Inspector")]
public GameObject redEffect;
public GameObject greenEffect;
public GameObject yellowEffect;
public GameObject purpleEffect;
public GameObject blueEffect;
[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("")]
[Header("Inspector")]
public float baseScale = 1.0f;
public bool useRandomScale = true;
public float minScaleMultiplier = 0.8f;
public float maxScaleMultiplier = 1.2f;
[Header("Ծ")]
public float jumpForce = 5.0f; // ϵijʼٶ
public float gravity = -12.0f; //
[Header("Inspector")]
public float jumpForce = 5.0f; // Documentation text normalized.
public float gravity = -16f; // Documentation text normalized.
[Header("ʱ͸ȿ ()")]
public float fadeInTime = 0.1f; // ɺɽ (0->1)
public float fadeOutStartTime = 0.6f; // ɺڼ뿪ʼ
public float fadeOutDuration = 0.3f; // ʱ
[Header("Inspector")]
public float fadeInTime = 0.1f; // Documentation text normalized.
public float fadeOutStartTime = 0.6f; // Documentation text normalized.
public float fadeOutDuration = 0.35f; // Documentation text normalized.
// Cache spawn transforms to avoid accessing destroyed GameObject references.
private Transform redSpawn;
@@ -48,8 +48,8 @@ public class Animation_GenerateJudgementSituationPrefab : MonoBehaviour
if (Instance == null)
{
Instance = this;
// עһδʱ¼
// DontDestroyOnLoad(gameObject); // Ƴ¼ʱ
// Documentation text normalized.
// Documentation text normalized.
}
else if (Instance != this)
{
@@ -150,12 +150,12 @@ public class Animation_GenerateJudgementSituationPrefab : MonoBehaviour
GameObject instance = Instantiate(prefabToUse, spawnPoint);
instance.transform.localPosition = Vector3.zero;
//
// Documentation text normalized.
float finalScale = baseScale;
if (useRandomScale) finalScale *= Random.Range(minScaleMultiplier, maxScaleMultiplier);
instance.transform.localScale = new Vector3(finalScale, finalScale, 1f);
// ˶߼
// Documentation text normalized.
StartCoroutine(AnimateSprite(instance));
}
@@ -168,10 +168,10 @@ public class Animation_GenerateJudgementSituationPrefab : MonoBehaviour
float vVelocity = jumpForce;
Vector3 currentLocalPos = Vector3.zero;
// ڣʼʱ + ʱ
// Documentation text normalized.
float totalLifeTime = fadeOutStartTime + fadeOutDuration;
// ʼ͸
// Documentation text normalized.
if (sr != null)
{
Color c = sr.color;
@@ -179,7 +179,7 @@ public class Animation_GenerateJudgementSituationPrefab : MonoBehaviour
sr.color = c;
}
// ֻҪûͳִ
// Documentation text normalized.
while (elapsed < totalLifeTime)
{
if (obj == null) yield break;
@@ -187,28 +187,28 @@ public class Animation_GenerateJudgementSituationPrefab : MonoBehaviour
float dt = Time.deltaTime;
elapsed += dt;
// --- 1. λ ---
// Documentation text normalized.
vVelocity += gravity * dt;
currentLocalPos.y += vVelocity * dt;
obj.transform.localPosition = currentLocalPos;
// --- 2. ͸߼ () ---
// Documentation text normalized.
if (sr != null)
{
float alpha;
// Խ׶Σǰʱ < fadeInTime
// Documentation text normalized.
if (elapsed < fadeInTime)
{
alpha = Mathf.InverseLerp(0f, fadeInTime, elapsed);
}
// ׶Σǰʱ > fadeOutStartTime
// Documentation text normalized.
else if (elapsed > fadeOutStartTime)
{
// fadeOutStartTime totalLifeTime ֮ 1 䵽 0
// Documentation text normalized.
alpha = Mathf.InverseLerp(totalLifeTime, fadeOutStartTime, elapsed);
}
// мȫʾ׶
// Documentation text normalized.
else
{
alpha = 1f;
@@ -222,7 +222,7 @@ public class Animation_GenerateJudgementSituationPrefab : MonoBehaviour
yield return null;
}
// --- ȷһ֡ȫ͸ ---
// Documentation text normalized.
if (obj != null && sr != null)
{
Color c = sr.color;
@@ -230,8 +230,7 @@ public class Animation_GenerateJudgementSituationPrefab : MonoBehaviour
sr.color = c;
}
// ȴȾɣֹɾ
yield return new WaitForEndOfFrame();
// Documentation text normalized.
if (obj != null) Destroy(obj);
}
@@ -240,8 +239,7 @@ public class Animation_GenerateJudgementSituationPrefab : MonoBehaviour
{
if (string.IsNullOrEmpty(color)) return null;
// ÿεʱǷҪ»
CacheSpawnPointsIfNeeded();
// Documentation text normalized.
Transform point = null;
switch (color.ToLower())
@@ -287,4 +285,4 @@ public class Animation_GenerateJudgementSituationPrefab : MonoBehaviour
return prefab;
}
}
}