Strip debug logging from the game, fix screen weirdness

This commit is contained in:
Michal Pikulski
2025-10-14 15:53:58 +02:00
parent 18be597424
commit e8180b21bf
65 changed files with 768 additions and 411 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Core;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
@@ -72,7 +73,7 @@ namespace Cinematics
_cinematicSprites.enabled = true;
playableDirector.stopped += OnPlayableDirectorStopped;
playableDirector.Play(assetToPlay);
Debug.Log("Playing cinematic " + assetToPlay.name);
Logging.Debug("Playing cinematic " + assetToPlay.name);
_isCinematicPlaying = true;
OnCinematicStarted?.Invoke();
return playableDirector;
@@ -81,7 +82,7 @@ namespace Cinematics
void OnPlayableDirectorStopped(PlayableDirector director)
{
_cinematicSprites.enabled = false;
Debug.Log("Cinematic stopped!");
Logging.Debug("Cinematic stopped!");
_isCinematicPlaying = false;
OnCinematicStopped?.Invoke();
// Release the addressable handle associated with this director
@@ -100,7 +101,7 @@ namespace Cinematics
// Store the handle for later release
_addressableHandles[playableDirector] = handle;
Debug.Log($"[CinematicsManager] Loaded addressable cinematic: {key}");
Logging.Debug($"[CinematicsManager] Loaded addressable cinematic: {key}");
return PlayCinematic(result);
}
@@ -112,7 +113,7 @@ namespace Cinematics
{
if (playableDirector != null && playableDirector.state == PlayState.Playing)
{
Debug.Log("Skipping current cinematic");
Logging.Debug("Skipping current cinematic");
playableDirector.Stop();
}
}
@@ -124,7 +125,7 @@ namespace Cinematics
{
if (_addressableHandles.TryGetValue(director, out var handle))
{
Debug.Log($"[CinematicsManager] Releasing addressable handle for cinematic");
Logging.Debug($"[CinematicsManager] Releasing addressable handle for cinematic");
Addressables.Release(handle);
_addressableHandles.Remove(director);
}
@@ -157,7 +158,7 @@ namespace Cinematics
/// <returns>The PlayableDirector playing the cinematic</returns>
public async System.Threading.Tasks.Task<PlayableDirector> PlayCinematicWithLoadingScreen(string key)
{
Debug.Log($"[CinematicsManager] Preparing to load cinematic with loading screen: {key}");
Logging.Debug($"[CinematicsManager] Preparing to load cinematic with loading screen: {key}");
// First, show the loading screen BEFORE creating any async operations
UI.LoadingScreenController.Instance.ShowLoadingScreen();
@@ -166,7 +167,7 @@ namespace Cinematics
await System.Threading.Tasks.Task.Yield();
// Now create the load handle and track its progress
Debug.Log($"[CinematicsManager] Starting cinematic asset load: {key}");
Logging.Debug($"[CinematicsManager] Starting cinematic asset load: {key}");
AsyncOperationHandle<PlayableAsset> handle = Addressables.LoadAssetAsync<PlayableAsset>(key);
// Update the loading screen with the progress provider after the handle is created
@@ -178,7 +179,7 @@ namespace Cinematics
// Store the handle for later release
_addressableHandles[playableDirector] = handle;
Debug.Log($"[CinematicsManager] Cinematic loaded: {key}");
Logging.Debug($"[CinematicsManager] Cinematic loaded: {key}");
// Hide the loading screen
UI.LoadingScreenController.Instance.HideLoadingScreen();
@@ -186,7 +187,7 @@ namespace Cinematics
// Important: Wait for the loading screen to be fully hidden before playing the cinematic
await UI.LoadingScreenController.Instance.WaitForLoadingScreenToHideAsync();
Debug.Log($"[CinematicsManager] Loading screen hidden, now playing cinematic: {key}");
Logging.Debug($"[CinematicsManager] Loading screen hidden, now playing cinematic: {key}");
// Play the cinematic
return PlayCinematic(result);

View File

@@ -1,3 +1,4 @@
using Core;
using Input;
using UnityEngine;
using UnityEngine.UI;
@@ -76,7 +77,7 @@ namespace Cinematics
private void DoSkipCinematic()
{
CinematicsManager.Instance.SkipCurrentCinematic();
Debug.Log("Cinematic skipped via touch hold");
Logging.Debug("Cinematic skipped via touch hold");
// Reset UI
if (radialProgressBar != null)
@@ -101,7 +102,7 @@ namespace Cinematics
_skipPerformed = false;
_holdStartTime = Time.time;
Debug.Log("Starting cinematic skip gesture");
Logging.Debug("Starting cinematic skip gesture");
}
public void OnHoldMove(Vector2 position)
@@ -120,7 +121,7 @@ namespace Cinematics
radialProgressBar.fillAmount = 0f;
}
Debug.Log("Cinematic skip gesture canceled");
Logging.Debug("Cinematic skip gesture canceled");
}
#endregion
}