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:
2026-08-17 22:13:05 -03:00
parent 072537211c
commit c5915c2e97
6 changed files with 20333 additions and 7257 deletions
@@ -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;
File diff suppressed because it is too large Load Diff
+7443 -3088
View File
File diff suppressed because it is too large Load Diff
+8518 -4163
View File
File diff suppressed because it is too large Load Diff