成就系统 巨大修改 新的ui 黑白效果 等一堆
This commit is contained in:
@@ -11,8 +11,14 @@ public class NotePool : MonoBehaviour
|
||||
public GameObject[] holdNotePrefabs; // ������Ƭ��Ԥ����
|
||||
public GameObject[] holdNoteEndPrefabs; // ������β��ר�ó�����Ԥ���壨��ѡ��
|
||||
public GameObject[] startNotePrefabs; // ������startƬ��Ԥ����
|
||||
private int poolSize = 24; // ÿ�����͵������ش�С (increased)
|
||||
private int maxPoolSize = 120; // �ص�������� (increased)
|
||||
|
||||
[Header("Pool Size")]
|
||||
public int poolSize = 24;
|
||||
public int maxPoolSize = 300;
|
||||
[Tooltip("Multiplier for hold segment pool size (per color).")]
|
||||
public int holdSegmentPoolMultiplier = 8;
|
||||
[Tooltip("Multiplier for hold end pool size (per color).")]
|
||||
public int holdEndPoolMultiplier = 8;
|
||||
|
||||
// ��ɫ�������Ŀ���ӳ�䣬����ÿ�� switch
|
||||
private Dictionary<string, int> colorIndexMap;
|
||||
@@ -118,10 +124,10 @@ public class NotePool : MonoBehaviour
|
||||
private IEnumerator PrewarmCoroutine(int colorCount)
|
||||
{
|
||||
// Calculate targets
|
||||
int noteTarget = poolSize; // per color
|
||||
int startTarget = poolSize;
|
||||
int holdTarget = poolSize * 5;
|
||||
int endTarget = poolSize * 5;
|
||||
int noteTarget = Mathf.Min(poolSize, maxPoolSize); // per color
|
||||
int startTarget = Mathf.Min(poolSize, maxPoolSize);
|
||||
int holdTarget = Mathf.Min(poolSize * Mathf.Max(1, holdSegmentPoolMultiplier), maxPoolSize);
|
||||
int endTarget = Mathf.Min(poolSize * Mathf.Max(1, holdEndPoolMultiplier), maxPoolSize);
|
||||
|
||||
while (true)
|
||||
{
|
||||
@@ -237,6 +243,34 @@ public class NotePool : MonoBehaviour
|
||||
{
|
||||
if (obj == null || pool == null) return; // ��ֹ������
|
||||
|
||||
// Defensive: unregister/unlock any TrackKeyManager state referencing this object to avoid stale queues/locks
|
||||
try
|
||||
{
|
||||
// Try to determine track index from Note or HoldNote components
|
||||
int trackIdx = -1;
|
||||
var noteComp = obj.GetComponent<Note>();
|
||||
if (noteComp != null)
|
||||
{
|
||||
trackIdx = noteComp.GetTrackIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
var holdComp = obj.GetComponent<HoldNote>();
|
||||
if (holdComp != null)
|
||||
{
|
||||
trackIdx = holdComp.trackIndex;
|
||||
}
|
||||
}
|
||||
|
||||
string id = obj.GetInstanceID().ToString();
|
||||
if (TrackKeyManager.Instance != null && trackIdx >= 0)
|
||||
{
|
||||
try { TrackKeyManager.Instance.UnregisterKey(trackIdx, id); } catch { }
|
||||
try { TrackKeyManager.Instance.UnlockTrackForJudge(trackIdx, id); } catch { }
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
// �����ظ��黹������������ڳ��ڣ�ֱ�Ӻ���
|
||||
GamePlay.PoolItem pi = obj.GetComponent<GamePlay.PoolItem>();
|
||||
if (pi != null && pi.inPool) return;
|
||||
|
||||
Reference in New Issue
Block a user