备份,准备做双端
This commit is contained in:
@@ -213,9 +213,20 @@ public class globalNoteEffect : MonoBehaviour
|
||||
if (shake.timeSettings.fadeOutCurve == null || shake.timeSettings.fadeOutCurve.length == 0)
|
||||
shake.timeSettings.fadeOutCurve = AnimationCurve.Linear(0f, 1f, 1f, 0f);
|
||||
|
||||
shake.shakers = new[] { shake.positionShake, shake.rotationShake };
|
||||
shake.sum = new Vector3[2];
|
||||
shake.StartShake();
|
||||
// 复用内部数组,仅在缺失/尺寸不符时重建,避免每次(近乎每音符)相机震动都分配两个数组。
|
||||
if (shake.shakers == null || shake.shakers.Length != 2)
|
||||
shake.shakers = new[] { shake.positionShake, shake.rotationShake };
|
||||
if (shake.sum == null || shake.sum.Length != 2)
|
||||
shake.sum = new Vector3[2];
|
||||
|
||||
try
|
||||
{
|
||||
shake.StartShake();
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"[globalNoteEffect] Camera shake failed (check shake asset references in Inspector): {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void TriggerFlashBlink()
|
||||
|
||||
Reference in New Issue
Block a user