ui基本完毕,修了一大把的bug
This commit is contained in:
@@ -115,7 +115,7 @@ public class NotePool : MonoBehaviour
|
||||
var anim = AnimationController.Global ?? SceneObjectLookupCache.FindAny<AnimationController>();
|
||||
if (anim != null)
|
||||
{
|
||||
anim.PrewarmParticles(2);
|
||||
anim.PrewarmParticles(6);
|
||||
if (verboseLogging) Debug.Log("NotePool: requested AnimationController prewarm");
|
||||
}
|
||||
}
|
||||
@@ -192,6 +192,7 @@ public class NotePool : MonoBehaviour
|
||||
if (pool.Count > 0)
|
||||
{
|
||||
GameObject obj = pool.Pop();
|
||||
GamePlay.PoolItem pi = null;
|
||||
if (obj == null)
|
||||
{
|
||||
// Documentation text normalized.
|
||||
@@ -199,26 +200,26 @@ public class NotePool : MonoBehaviour
|
||||
else
|
||||
{
|
||||
// Documentation text normalized.
|
||||
GamePlay.PoolItem pi = obj.GetComponent<GamePlay.PoolItem>();
|
||||
pi = obj.GetComponent<GamePlay.PoolItem>();
|
||||
if (pi == null || prefab == null || pi.prefabName != prefab.name)
|
||||
{
|
||||
// Documentation text normalized.
|
||||
if (pi == null && verboseLogging) Debug.LogWarning("PoolItem missing on pooled object, replacing.");
|
||||
Destroy(obj);
|
||||
obj = InstantiateAndPrepare(prefab);
|
||||
pi = obj != null ? obj.GetComponent<GamePlay.PoolItem>() : null;
|
||||
}
|
||||
}
|
||||
obj.transform.SetParent(null);
|
||||
obj.SetActive(true);
|
||||
|
||||
// mark as taken from pool
|
||||
GamePlay.PoolItem takenPi = obj.GetComponent<GamePlay.PoolItem>();
|
||||
if (takenPi != null)
|
||||
// mark as taken from pool (reuse the PoolItem already resolved above)
|
||||
if (pi != null)
|
||||
{
|
||||
takenPi.inPool = false;
|
||||
if (takenPi.initialLocalScaleCaptured)
|
||||
pi.inPool = false;
|
||||
if (pi.initialLocalScaleCaptured)
|
||||
{
|
||||
obj.transform.localScale = takenPi.initialLocalScale;
|
||||
obj.transform.localScale = pi.initialLocalScale;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user