Strip debug logging from the game, fix screen weirdness
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user