mirror of
https://github.com/Earth-Genesis-Games/Ajedrez_Purgatorio.git
synced 2026-09-11 09:47:35 +00:00
fix: dark overlay + pause input error
- PromotionUI: deactivate DimBG (permanent 70% black overlay) on Awake,
show only during promotion selection
- PauseMenuController: remove Input.GetButtonDown('Pause') — button not
defined in InputManager, use KeyCode.Escape only
- SceneTransitionManager: use Time.unscaledDeltaTime and
WaitForSecondsRealtime so fades don't freeze when Time.timeScale=0
This commit is contained in:
@@ -125,7 +125,7 @@ public class SceneTransitionManager : MonoBehaviour
|
||||
Debug.Log($"[SceneTransitionManager] Escena '{sceneName}' cargada.");
|
||||
|
||||
// Pequeña pausa antes de fade in (para evitar flicker)
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
yield return new WaitForSecondsRealtime(0.1f);
|
||||
|
||||
// Fade in (negro desaparece)
|
||||
yield return FadeRoutine(1f, 0f, _fadeDuration, _fadeInCurve);
|
||||
@@ -143,7 +143,7 @@ public class SceneTransitionManager : MonoBehaviour
|
||||
|
||||
while (elapsed < duration)
|
||||
{
|
||||
elapsed += Time.deltaTime;
|
||||
elapsed += Time.unscaledDeltaTime;
|
||||
float normalizedTime = Mathf.Clamp01(elapsed / duration);
|
||||
float curveValue = curve.Evaluate(normalizedTime);
|
||||
float alpha = Mathf.Lerp(from, to, curveValue);
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace AjedrezPurgatorio.UI
|
||||
private void Update()
|
||||
{
|
||||
// Listen for Escape key or gamepad Start button
|
||||
if (Input.GetKeyDown(KeyCode.Escape) || Input.GetButtonDown("Pause"))
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
if (_isPaused)
|
||||
Hide();
|
||||
|
||||
@@ -17,9 +17,18 @@ public class PromotionUI : MonoBehaviour
|
||||
|
||||
private Piece _pawnToPromote;
|
||||
private Action<PieceType> _onPromotionSelected;
|
||||
private GameObject _dimBG;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
// Find DimBG sibling (always-active dark overlay blocking input)
|
||||
Transform dimBGTransform = transform.Find("DimBG");
|
||||
if (dimBGTransform != null)
|
||||
{
|
||||
_dimBG = dimBGTransform.gameObject;
|
||||
_dimBG.SetActive(false);
|
||||
}
|
||||
|
||||
if (_promotionPanel != null)
|
||||
_promotionPanel.SetActive(false);
|
||||
|
||||
@@ -48,6 +57,7 @@ public class PromotionUI : MonoBehaviour
|
||||
if (_promotionPanel != null)
|
||||
{
|
||||
_promotionPanel.SetActive(true);
|
||||
if (_dimBG != null) _dimBG.SetActive(true);
|
||||
|
||||
// Pausar el juego mientras el jugador elige
|
||||
Time.timeScale = 0f;
|
||||
@@ -65,6 +75,7 @@ public class PromotionUI : MonoBehaviour
|
||||
// Ocultar UI
|
||||
if (_promotionPanel != null)
|
||||
_promotionPanel.SetActive(false);
|
||||
if (_dimBG != null) _dimBG.SetActive(false);
|
||||
|
||||
// Reanudar el juego
|
||||
Time.timeScale = 1f;
|
||||
|
||||
+4358
-3
File diff suppressed because it is too large
Load Diff
+7443
-3088
File diff suppressed because it is too large
Load Diff
+8518
-4163
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user