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

@@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: 6f3207429a65b3e4b83935ac19791077 m_DefaultGroup: 6f3207429a65b3e4b83935ac19791077
m_currentHash: m_currentHash:
serializedVersion: 2 serializedVersion: 2
Hash: 8453796ea514a8db40e72d511ee4981c Hash: 00000000000000000000000000000000
m_OptimizeCatalogSize: 0 m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0 m_BuildRemoteCatalog: 0
m_CatalogRequestsTimeout: 0 m_CatalogRequestsTimeout: 0

View File

@@ -92,7 +92,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!224 &1302888740346723223 --- !u!224 &1302888740346723223
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -688,8 +688,8 @@ RectTransform:
- {fileID: 3400029894692319192} - {fileID: 3400029894692319192}
m_Father: {fileID: 5605205583985027889} m_Father: {fileID: 5605205583985027889}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30} m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
@@ -823,9 +823,9 @@ RectTransform:
- {fileID: 7803147924421545447} - {fileID: 7803147924421545447}
m_Father: {fileID: 5605205583985027889} m_Father: {fileID: 5605205583985027889}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: -60} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30} m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2290562928139384544 --- !u!222 &2290562928139384544
@@ -1642,9 +1642,9 @@ RectTransform:
- {fileID: 6162719476639538323} - {fileID: 6162719476639538323}
m_Father: {fileID: 5605205583985027889} m_Father: {fileID: 5605205583985027889}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 120} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30} m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3956398402257402681 --- !u!222 &3956398402257402681
@@ -1741,6 +1741,139 @@ MonoBehaviour:
m_StringArgument: m_StringArgument:
m_BoolArgument: 1 m_BoolArgument: 1
m_CallState: 2 m_CallState: 2
--- !u!1 &5428575275238917432
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7984867635544047636}
- component: {fileID: 7625231543093897207}
- component: {fileID: 2449943578766449663}
- component: {fileID: 2858549979657146258}
m_Layer: 0
m_Name: Exit (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7984867635544047636
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5428575275238917432}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3120496234660820654}
m_Father: {fileID: 5605205583985027889}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7625231543093897207
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5428575275238917432}
m_CullTransparentMesh: 1
--- !u!114 &2449943578766449663
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5428575275238917432}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &2858549979657146258
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5428575275238917432}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 0.85165936, b: 0.5058824, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 2449943578766449663}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7928661763020144797}
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
m_MethodName: ReloadLevel
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &5544888797992325527 --- !u!1 &5544888797992325527
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1775,9 +1908,9 @@ RectTransform:
- {fileID: 3949582524682304579} - {fileID: 3949582524682304579}
m_Father: {fileID: 5605205583985027889} m_Father: {fileID: 5605205583985027889}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 60} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30} m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4255447181943714037 --- !u!222 &4255447181943714037
@@ -2323,6 +2456,142 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &8078932926504279854
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3120496234660820654}
- component: {fileID: 6119350696632336213}
- component: {fileID: 3030293546037678981}
m_Layer: 0
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3120496234660820654
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8078932926504279854}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7984867635544047636}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6119350696632336213
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8078932926504279854}
m_CullTransparentMesh: 1
--- !u!114 &3030293546037678981
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8078932926504279854}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Reload current
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4281479730
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 20
m_fontSizeBase: 20
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &8099213920311068351 --- !u!1 &8099213920311068351
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -2468,6 +2737,8 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 5605205583985027889} - component: {fileID: 5605205583985027889}
- component: {fileID: 8594443110142453154}
- component: {fileID: 3446002550086852002}
m_Layer: 0 m_Layer: 0
m_Name: Buttons m_Name: Buttons
m_TagString: Untagged m_TagString: Untagged
@@ -2490,11 +2761,52 @@ RectTransform:
- {fileID: 9052230212113207254} - {fileID: 9052230212113207254}
- {fileID: 44375243138864492} - {fileID: 44375243138864492}
- {fileID: 6855320393561945426} - {fileID: 6855320393561945426}
- {fileID: 7984867635544047636}
- {fileID: 7083543314533737593} - {fileID: 7083543314533737593}
m_Father: {fileID: 1302888740346723223} m_Father: {fileID: 1302888740346723223}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0} m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0} m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 120} m_AnchoredPosition: {x: -6.442688, y: 141.47559}
m_SizeDelta: {x: 100, y: 100} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &8594443110142453154
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9039430485754110792}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.VerticalLayoutGroup
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 17.13
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!114 &3446002550086852002
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9039430485754110792}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.ContentSizeFitter
m_HorizontalFit: 2
m_VerticalFit: 2

View File

@@ -1,6 +1,7 @@
using UnityEngine; using UnityEngine;
using Unity.Cinemachine; using Unity.Cinemachine;
using System; using System;
using Core;
namespace AppleHillsCamera namespace AppleHillsCamera
{ {
@@ -76,7 +77,7 @@ namespace AppleHillsCamera
{ {
if (referenceMarker == null) if (referenceMarker == null)
{ {
Debug.LogWarning("CameraScreenAdapter: Missing reference marker."); Logging.Warning("CameraScreenAdapter: Missing reference marker.");
return; return;
} }
@@ -95,7 +96,7 @@ namespace AppleHillsCamera
var lens = _virtualCamera.Lens; var lens = _virtualCamera.Lens;
lens.OrthographicSize = orthoSize; lens.OrthographicSize = orthoSize;
_virtualCamera.Lens = lens; _virtualCamera.Lens = lens;
Debug.Log($"Cinemachine Camera adapted: Width={targetWidth}, Aspect={screenAspect:F2}, OrthoSize={orthoSize:F2}"); Logging.Debug($"Cinemachine Camera adapted: Width={targetWidth}, Aspect={screenAspect:F2}, OrthoSize={orthoSize:F2}");
} }
else else
{ {
@@ -103,11 +104,11 @@ namespace AppleHillsCamera
if (_regularCamera.orthographic) if (_regularCamera.orthographic)
{ {
_regularCamera.orthographicSize = orthoSize; _regularCamera.orthographicSize = orthoSize;
Debug.Log($"Camera adapted: Width={targetWidth}, Aspect={screenAspect:F2}, OrthoSize={orthoSize:F2}"); Logging.Debug($"Camera adapted: Width={targetWidth}, Aspect={screenAspect:F2}, OrthoSize={orthoSize:F2}");
} }
else else
{ {
Debug.LogWarning("CameraScreenAdapter: Regular camera is not in orthographic mode."); Logging.Warning("CameraScreenAdapter: Regular camera is not in orthographic mode.");
return; return;
} }
} }

View File

@@ -1,6 +1,7 @@
using AppleHills.Core; using AppleHills.Core;
using UnityEngine; using UnityEngine;
using System; using System;
using Core;
namespace AppleHillsCamera namespace AppleHillsCamera
{ {
@@ -168,7 +169,7 @@ namespace AppleHillsCamera
{ {
if (debugMode) if (debugMode)
{ {
Debug.Log($"Camera adjusted event received by {gameObject.name}, updating position"); Logging.Debug($"Camera adjusted event received by {gameObject.name}, updating position");
} }
// Ensure we have the latest camera reference // Ensure we have the latest camera reference
@@ -210,14 +211,14 @@ namespace AppleHillsCamera
if (_camera != null && adapter.GetControlledCamera() == _camera) if (_camera != null && adapter.GetControlledCamera() == _camera)
{ {
cameraAdapter = adapter; cameraAdapter = adapter;
Debug.Log($"EdgeAnchor on {gameObject.name} auto-connected to CameraScreenAdapter on {cameraAdapter.gameObject.name}"); Logging.Debug($"EdgeAnchor on {gameObject.name} auto-connected to CameraScreenAdapter on {cameraAdapter.gameObject.name}");
return; return;
} }
} }
// If no matching camera found, use the first one // If no matching camera found, use the first one
cameraAdapter = adapters[0]; cameraAdapter = adapters[0];
Debug.Log($"EdgeAnchor on {gameObject.name} auto-connected to CameraScreenAdapter on {cameraAdapter.gameObject.name}"); Logging.Debug($"EdgeAnchor on {gameObject.name} auto-connected to CameraScreenAdapter on {cameraAdapter.gameObject.name}");
} }
} }
@@ -237,7 +238,7 @@ namespace AppleHillsCamera
{ {
if (debugMode) if (debugMode)
{ {
Debug.Log($"{gameObject.name}: Camera ortho size changed from {_lastOrthoSize} to {_camera.orthographicSize}"); Logging.Debug($"{gameObject.name}: Camera ortho size changed from {_lastOrthoSize} to {_camera.orthographicSize}");
} }
_lastOrthoSize = _camera.orthographicSize; _lastOrthoSize = _camera.orthographicSize;
shouldUpdate = true; shouldUpdate = true;
@@ -296,7 +297,7 @@ namespace AppleHillsCamera
} }
else if (_camera != prevCamera && debugMode) else if (_camera != prevCamera && debugMode)
{ {
Debug.Log($"{gameObject.name}: Camera reference updated to {_camera.name}"); Logging.Debug($"{gameObject.name}: Camera reference updated to {_camera.name}");
} }
} }
@@ -340,7 +341,7 @@ namespace AppleHillsCamera
{ {
if (referenceMarker == null) if (referenceMarker == null)
{ {
Debug.LogWarning("EdgeAnchor: Missing reference marker."); Logging.Warning("EdgeAnchor: Missing reference marker.");
return; return;
} }
@@ -377,7 +378,7 @@ namespace AppleHillsCamera
// Apply the new position // Apply the new position
if (debugMode && Vector3.Distance(transform.position, newPosition) > 0.01f) if (debugMode && Vector3.Distance(transform.position, newPosition) > 0.01f)
{ {
Debug.Log($"{gameObject.name} position updated: {transform.position} -> {newPosition}, Camera OrthoSize: {_camera.orthographicSize}"); Logging.Debug($"{gameObject.name} position updated: {transform.position} -> {newPosition}, Camera OrthoSize: {_camera.orthographicSize}");
} }
transform.position = newPosition; transform.position = newPosition;

View File

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

View File

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

View File

@@ -3,6 +3,7 @@ using AppleHills.Core.Settings;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using Core;
using UI; using UI;
/// <summary> /// <summary>
@@ -81,11 +82,11 @@ public class GameManager : MonoBehaviour
pauseMenu.OnGamePaused += OnPauseMenuPaused; pauseMenu.OnGamePaused += OnPauseMenuPaused;
pauseMenu.OnGameResumed += OnPauseMenuResumed; pauseMenu.OnGameResumed += OnPauseMenuResumed;
Debug.Log("[GameManager] Subscribed to PauseMenu events"); Logging.Debug("[GameManager] Subscribed to PauseMenu events");
} }
else else
{ {
Debug.LogWarning("[GameManager] PauseMenu not found. Pause functionality won't work properly."); Logging.Warning("[GameManager] PauseMenu not found. Pause functionality won't work properly.");
} }
} }
@@ -116,7 +117,7 @@ public class GameManager : MonoBehaviour
component.Pause(); component.Pause();
} }
Debug.Log($"[GameManager] Registered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}"); Logging.Debug($"[GameManager] Registered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}");
} }
} }
@@ -129,7 +130,7 @@ public class GameManager : MonoBehaviour
if (component != null && _pausableComponents.Contains(component)) if (component != null && _pausableComponents.Contains(component))
{ {
_pausableComponents.Remove(component); _pausableComponents.Remove(component);
Debug.Log($"[GameManager] Unregistered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}"); Logging.Debug($"[GameManager] Unregistered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}");
} }
} }
@@ -167,7 +168,7 @@ public class GameManager : MonoBehaviour
// Broadcast pause event // Broadcast pause event
OnGamePaused?.Invoke(); OnGamePaused?.Invoke();
Debug.Log($"[GameManager] Game paused. Paused {_pausableComponents.Count} components."); Logging.Debug($"[GameManager] Game paused. Paused {_pausableComponents.Count} components.");
} }
/// <summary> /// <summary>
@@ -188,7 +189,7 @@ public class GameManager : MonoBehaviour
// Broadcast resume event // Broadcast resume event
OnGameResumed?.Invoke(); OnGameResumed?.Invoke();
Debug.Log($"[GameManager] Game resumed. Resumed {_pausableComponents.Count} components."); Logging.Debug($"[GameManager] Game resumed. Resumed {_pausableComponents.Count} components.");
} }
/// <summary> /// <summary>
@@ -204,7 +205,7 @@ public class GameManager : MonoBehaviour
private void InitializeSettings() private void InitializeSettings()
{ {
Debug.Log("Starting settings initialization..."); Logging.Debug("Starting settings initialization...");
// Load settings synchronously // Load settings synchronously
var playerSettings = SettingsProvider.Instance.LoadSettingsSynchronous<PlayerFollowerSettings>(); var playerSettings = SettingsProvider.Instance.LoadSettingsSynchronous<PlayerFollowerSettings>();
@@ -215,7 +216,7 @@ public class GameManager : MonoBehaviour
if (playerSettings != null) if (playerSettings != null)
{ {
ServiceLocator.Register<IPlayerFollowerSettings>(playerSettings); ServiceLocator.Register<IPlayerFollowerSettings>(playerSettings);
Debug.Log("PlayerFollowerSettings registered successfully"); Logging.Debug("PlayerFollowerSettings registered successfully");
} }
else else
{ {
@@ -225,7 +226,7 @@ public class GameManager : MonoBehaviour
if (interactionSettings != null) if (interactionSettings != null)
{ {
ServiceLocator.Register<IInteractionSettings>(interactionSettings); ServiceLocator.Register<IInteractionSettings>(interactionSettings);
Debug.Log("InteractionSettings registered successfully"); Logging.Debug("InteractionSettings registered successfully");
} }
else else
{ {
@@ -235,7 +236,7 @@ public class GameManager : MonoBehaviour
if (minigameSettings != null) if (minigameSettings != null)
{ {
ServiceLocator.Register<IDivingMinigameSettings>(minigameSettings); ServiceLocator.Register<IDivingMinigameSettings>(minigameSettings);
Debug.Log("MinigameSettings registered successfully"); Logging.Debug("MinigameSettings registered successfully");
} }
else else
{ {
@@ -246,11 +247,11 @@ public class GameManager : MonoBehaviour
_settingsLoaded = playerSettings != null && interactionSettings != null && minigameSettings != null; _settingsLoaded = playerSettings != null && interactionSettings != null && minigameSettings != null;
if (_settingsLoaded) if (_settingsLoaded)
{ {
Debug.Log("All settings loaded and registered with ServiceLocator"); Logging.Debug("All settings loaded and registered with ServiceLocator");
} }
else else
{ {
Debug.LogWarning("Some settings failed to load - check that all settings assets exist and are marked as Addressables"); Logging.Warning("Some settings failed to load - check that all settings assets exist and are marked as Addressables");
} }
} }
@@ -259,7 +260,7 @@ public class GameManager : MonoBehaviour
/// </summary> /// </summary>
private void InitializeDeveloperSettings() private void InitializeDeveloperSettings()
{ {
Debug.Log("Starting developer settings initialization..."); Logging.Debug("Starting developer settings initialization...");
// Load developer settings // Load developer settings
var divingDevSettings = DeveloperSettingsProvider.Instance.GetSettings<DivingDeveloperSettings>(); var divingDevSettings = DeveloperSettingsProvider.Instance.GetSettings<DivingDeveloperSettings>();
@@ -268,11 +269,11 @@ public class GameManager : MonoBehaviour
if (_developerSettingsLoaded) if (_developerSettingsLoaded)
{ {
Debug.Log("All developer settings loaded successfully"); Logging.Debug("All developer settings loaded successfully");
} }
else else
{ {
Debug.LogWarning("Some developer settings failed to load"); Logging.Warning("Some developer settings failed to load");
} }
} }

View File

@@ -13,11 +13,5 @@
{ {
UnityEngine.Debug.LogWarning(message); UnityEngine.Debug.LogWarning(message);
} }
[System.Diagnostics.Conditional("ENABLE_LOG")]
public static void Error(object message)
{
UnityEngine.Debug.LogError(message);
}
} }
} }

View File

@@ -123,7 +123,7 @@ namespace Core
var scene = SceneManager.GetSceneByName(sceneName); var scene = SceneManager.GetSceneByName(sceneName);
if (!scene.isLoaded) if (!scene.isLoaded)
{ {
Debug.LogWarning($"SceneManagerService: Attempted to unload scene '{sceneName}', but it is not loaded."); Logging.Warning($"SceneManagerService: Attempted to unload scene '{sceneName}', but it is not loaded.");
return; return;
} }
SceneUnloadStarted?.Invoke(sceneName); SceneUnloadStarted?.Invoke(sceneName);
@@ -264,6 +264,11 @@ namespace Core
// Tracks the currently loaded gameplay scene (not persistent/bootstrapper) // Tracks the currently loaded gameplay scene (not persistent/bootstrapper)
public string CurrentGameplayScene { get; private set; } = "MainMenu"; public string CurrentGameplayScene { get; private set; } = "MainMenu";
public async Task ReloadCurrentScene(IProgress<float> progress = null)
{
await SwitchSceneAsync(CurrentGameplayScene, progress);
}
// Switches from current gameplay scene to a new one // Switches from current gameplay scene to a new one
public async Task SwitchSceneAsync(string newSceneName, IProgress<float> progress = null) public async Task SwitchSceneAsync(string newSceneName, IProgress<float> progress = null)
{ {
@@ -277,7 +282,7 @@ namespace Core
DestroyImmediate(astar.gameObject); DestroyImmediate(astar.gameObject);
} }
// Unload previous gameplay scene (if not BootstrapScene and not same as new) // Unload previous gameplay scene (if not BootstrapScene and not same as new)
if (!string.IsNullOrEmpty(CurrentGameplayScene) && CurrentGameplayScene != newSceneName && CurrentGameplayScene != BootstrapSceneName) if (!string.IsNullOrEmpty(CurrentGameplayScene)&& CurrentGameplayScene != BootstrapSceneName)
{ {
var prevScene = SceneManager.GetSceneByName(CurrentGameplayScene); var prevScene = SceneManager.GetSceneByName(CurrentGameplayScene);
if (prevScene.isLoaded) if (prevScene.isLoaded)
@@ -286,7 +291,7 @@ namespace Core
} }
else else
{ {
Debug.LogWarning($"SceneManagerService: Previous scene '{CurrentGameplayScene}' is not loaded, skipping unload."); Logging.Warning($"SceneManagerService: Previous scene '{CurrentGameplayScene}' is not loaded, skipping unload.");
} }
} }
// Ensure BootstrapScene is loaded before loading new scene // Ensure BootstrapScene is loaded before loading new scene

View File

@@ -35,6 +35,7 @@ namespace Utility
public GameObject orientationPromptPrefab; public GameObject orientationPromptPrefab;
public event Action OnOrientationCorrect; public event Action OnOrientationCorrect;
public event Action OnOrientationIncorrect;
private GameObject _promptInstance; private GameObject _promptInstance;
private ScreenOrientationRequirement _requiredOrientation; private ScreenOrientationRequirement _requiredOrientation;
@@ -139,6 +140,13 @@ namespace Utility
private System.Collections.IEnumerator ContinuousOrientationCheckRoutine() private System.Collections.IEnumerator ContinuousOrientationCheckRoutine()
{ {
while (!IsOrientationCorrect())
{
yield return new WaitForSeconds(0.5f);
}
_orientationCorrect = true;
OnOrientationCorrect?.Invoke();
while (true) while (true)
{ {
// Wait for a short interval before checking again // Wait for a short interval before checking again
@@ -147,33 +155,11 @@ namespace Utility
// Check if orientation is now incorrect // Check if orientation is now incorrect
if (!IsOrientationCorrect()) if (!IsOrientationCorrect())
{ {
// Pause the game using DivingGameManager OnOrientationIncorrect?.Invoke();;
if (DivingGameManager.Instance != null) InputManager.Instance.SetInputMode(InputMode.UI);
{
DivingGameManager.Instance.Pause();
}
// Show the orientation prompt
ShowPrompt(); ShowPrompt();
_continuousOrientationCheckCoroutine = StartCoroutine(ContinuousOrientationCheckRoutine());
// Wait until orientation is correct again yield break; // Exit this coroutine
while (!IsOrientationCorrect())
{
yield return new WaitForSeconds(0.2f);
}
// Hide the prompt when orientation is correct again
if (_promptInstance != null)
{
Destroy(_promptInstance);
_promptInstance = null;
}
// Resume the game using DivingGameManager
if (DivingGameManager.Instance != null)
{
DivingGameManager.Instance.DoResume();
}
} }
} }
} }

View File

@@ -2,6 +2,7 @@
using UnityEngine; using UnityEngine;
using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets;
using System; using System;
using Core;
namespace AppleHills.Core.Settings namespace AppleHills.Core.Settings
{ {
@@ -91,13 +92,13 @@ namespace AppleHills.Core.Settings
Debug.LogError($"Failed to load developer settings at '{key}': {e.Message}"); Debug.LogError($"Failed to load developer settings at '{key}': {e.Message}");
} }
Debug.LogWarning($"Developer settings of type {type.Name} not found at addressable path '{key}'"); Logging.Warning($"Developer settings of type {type.Name} not found at addressable path '{key}'");
// Fallback to Resources for backward compatibility // Fallback to Resources for backward compatibility
T resourcesSettings = Resources.Load<T>($"{_addressablePath}/{type.Name}"); T resourcesSettings = Resources.Load<T>($"{_addressablePath}/{type.Name}");
if (resourcesSettings != null) if (resourcesSettings != null)
{ {
Debug.Log($"Found developer settings in Resources instead of Addressables at '{_addressablePath}/{type.Name}'"); Logging.Debug($"Found developer settings in Resources instead of Addressables at '{_addressablePath}/{type.Name}'");
_settingsCache[type] = resourcesSettings; _settingsCache[type] = resourcesSettings;
return resourcesSettings; return resourcesSettings;
} }

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Core;
using UnityEngine; using UnityEngine;
namespace AppleHills.Core.Settings namespace AppleHills.Core.Settings
@@ -20,7 +21,7 @@ namespace AppleHills.Core.Settings
public static void Register<T>(T service) where T : class public static void Register<T>(T service) where T : class
{ {
_services[typeof(T)] = service; _services[typeof(T)] = service;
Debug.Log($"Service registered: {typeof(T).Name}"); Logging.Debug($"Service registered: {typeof(T).Name}");
} }
/// <summary> /// <summary>
@@ -35,7 +36,7 @@ namespace AppleHills.Core.Settings
return service as T; return service as T;
} }
Debug.LogWarning($"Service of type {typeof(T).Name} not found!"); Logging.Warning($"Service of type {typeof(T).Name} not found!");
return null; return null;
} }
@@ -45,7 +46,7 @@ namespace AppleHills.Core.Settings
public static void Clear() public static void Clear()
{ {
_services.Clear(); _services.Clear();
Debug.Log("All services cleared"); Logging.Debug("All services cleared");
} }
} }
} }

View File

@@ -1,6 +1,7 @@
using UnityEngine; using UnityEngine;
using System; using System;
using System.Collections; using System.Collections;
using Core;
using Pathfinding; using Pathfinding;
public class AnneLiseBehaviour : MonoBehaviour public class AnneLiseBehaviour : MonoBehaviour
@@ -162,6 +163,6 @@ public class AnneLiseBehaviour : MonoBehaviour
} }
annaLiseIsReady = false; // Reset the flag after taking the photo annaLiseIsReady = false; // Reset the flag after taking the photo
} }
Debug.Log("Trafalgar touched Anna Lise"); Logging.Debug("Trafalgar touched Anna Lise");
} }
} }

View File

@@ -24,7 +24,7 @@ public class Distancemeasurer : MonoBehaviour
{ {
playerPosition = player.transform.position; playerPosition = player.transform.position;
distance = Vector2.Distance(placePosition, playerPosition); distance = Vector2.Distance(placePosition, playerPosition);
//Debug.Log("Distance to player: " + distance); //Logging.Debug("Distance to player: " + distance);
if (distance > playerToPlaceDistance && birdEyes.correctItemIsIn == true) if (distance > playerToPlaceDistance && birdEyes.correctItemIsIn == true)
{ {
birdEyes.BirdReveal(); birdEyes.BirdReveal();

View File

@@ -1,4 +1,5 @@
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using Core;
using Pixelplacement; using Pixelplacement;
using UnityEngine; using UnityEngine;
@@ -20,7 +21,7 @@ public class GardenerBehaviour : MonoBehaviour
public void stateSwitch (string StateName) public void stateSwitch (string StateName)
{ {
Debug.Log("State Switch to: " + StateName); Logging.Debug("State Switch to: " + StateName);
stateMachineRef.ChangeState(StateName); stateMachineRef.ChangeState(StateName);
} }
} }

View File

@@ -1,3 +1,4 @@
using Core;
using UnityEngine; using UnityEngine;
using Pixelplacement; using Pixelplacement;
@@ -18,12 +19,12 @@ public class LawnMowerBehaviour : MonoBehaviour
} }
public void mowerTouched() public void mowerTouched()
{ {
Debug.Log("Mower Touched"); Logging.Debug("Mower Touched");
} }
public void stateSwitch(string StateName) public void stateSwitch(string StateName)
{ {
Debug.Log("State Switch to: " + StateName); Logging.Debug("State Switch to: " + StateName);
stateMachineRef.ChangeState(StateName); stateMachineRef.ChangeState(StateName);
} }
} }

View File

@@ -1,6 +1,7 @@
using UnityEngine; using UnityEngine;
using Pixelplacement; using Pixelplacement;
using System.Collections; using System.Collections;
using Core;
public class PicnicBehaviour : MonoBehaviour public class PicnicBehaviour : MonoBehaviour
{ {
@@ -56,7 +57,7 @@ public class PicnicBehaviour : MonoBehaviour
{ {
animator.SetTrigger("theyAngry"); animator.SetTrigger("theyAngry");
//stateMachine.ChangeState("Picnic PPL Angry"); //stateMachine.ChangeState("Picnic PPL Angry");
Debug.Log("Hey! Don't steal my chocolate!"); Logging.Debug("Hey! Don't steal my chocolate!");
} }
public void destroyFakeChocolate() public void destroyFakeChocolate()

View File

@@ -1,3 +1,4 @@
using Core;
using Pixelplacement; using Pixelplacement;
using UnityEngine; using UnityEngine;
@@ -27,7 +28,7 @@ public class SoundGenerator : MonoBehaviour
if (!playerInside && other.CompareTag("Player")) if (!playerInside && other.CompareTag("Player"))
{ {
playerInside = true; playerInside = true;
Debug.Log("Player entered SoundGenerator trigger!"); Logging.Debug("Player entered SoundGenerator trigger!");
if (spriteRenderer != null && enterSprite != null) if (spriteRenderer != null && enterSprite != null)
{ {
spriteRenderer.sprite = enterSprite; spriteRenderer.sprite = enterSprite;
@@ -49,7 +50,7 @@ public class SoundGenerator : MonoBehaviour
if (playerInside && other.CompareTag("Player")) if (playerInside && other.CompareTag("Player"))
{ {
playerInside = false; playerInside = false;
Debug.Log("Player exited SoundGenerator trigger!"); Logging.Debug("Player exited SoundGenerator trigger!");
if (spriteRenderer != null && exitSprite != null) if (spriteRenderer != null && exitSprite != null)
{ {
spriteRenderer.sprite = exitSprite; spriteRenderer.sprite = exitSprite;

View File

@@ -48,7 +48,7 @@ public class soundBird_LandingBehaviour1 : MonoBehaviour
{ {
objectTween.Cancel(); // Stop the spline tween for this object objectTween.Cancel(); // Stop the spline tween for this object
} }
//Debug.Log("Tween finished!"); //Logging.Debug("Tween finished!");
if (stateMachine != null) if (stateMachine != null)
{ {
animator.SetBool("isScared", false); animator.SetBool("isScared", false);

View File

@@ -38,7 +38,7 @@ public class soundBird_TakeOffBehaviour : MonoBehaviour
objectTween.Cancel(); // Stop the spline tween for this object objectTween.Cancel(); // Stop the spline tween for this object
} }
//Debug.Log("Tween finished!"); //Logging.Debug("Tween finished!");
if (stateMachine != null) if (stateMachine != null)
{ {
stateMachine.ChangeState("SoundBirdFlyAround"); // Change to the desired state name stateMachine.ChangeState("SoundBirdFlyAround"); // Change to the desired state name

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using AppleHills.Data.CardSystem; using AppleHills.Data.CardSystem;
using Core;
using UnityEngine; using UnityEngine;
namespace Data.CardSystem namespace Data.CardSystem
@@ -100,7 +101,7 @@ namespace Data.CardSystem
{ {
playerInventory.BoosterPackCount += count; playerInventory.BoosterPackCount += count;
OnBoosterCountChanged?.Invoke(playerInventory.BoosterPackCount); OnBoosterCountChanged?.Invoke(playerInventory.BoosterPackCount);
Debug.Log($"[CardSystemManager] Added {count} booster pack(s). Total: {playerInventory.BoosterPackCount}"); Logging.Debug($"[CardSystemManager] Added {count} booster pack(s). Total: {playerInventory.BoosterPackCount}");
} }
/// <summary> /// <summary>
@@ -110,7 +111,7 @@ namespace Data.CardSystem
{ {
if (playerInventory.BoosterPackCount <= 0) if (playerInventory.BoosterPackCount <= 0)
{ {
Debug.LogWarning("[CardSystemManager] Attempted to open a booster pack, but none are available."); Logging.Warning("[CardSystemManager] Attempted to open a booster pack, but none are available.");
return new List<CardData>(); return new List<CardData>();
} }
@@ -129,7 +130,7 @@ namespace Data.CardSystem
// Notify listeners // Notify listeners
OnBoosterOpened?.Invoke(drawnCards); OnBoosterOpened?.Invoke(drawnCards);
Debug.Log($"[CardSystemManager] Opened a booster pack and obtained {drawnCards.Count} cards. Remaining boosters: {playerInventory.BoosterPackCount}"); Logging.Debug($"[CardSystemManager] Opened a booster pack and obtained {drawnCards.Count} cards. Remaining boosters: {playerInventory.BoosterPackCount}");
return drawnCards; return drawnCards;
} }
@@ -150,7 +151,7 @@ namespace Data.CardSystem
OnCardRarityUpgraded?.Invoke(existingCard); OnCardRarityUpgraded?.Invoke(existingCard);
} }
Debug.Log($"[CardSystemManager] Added duplicate card '{card.Name}'. Now have {existingCard.CopiesOwned} copies."); Logging.Debug($"[CardSystemManager] Added duplicate card '{card.Name}'. Now have {existingCard.CopiesOwned} copies.");
} }
else else
{ {
@@ -158,7 +159,7 @@ namespace Data.CardSystem
playerInventory.AddCard(card); playerInventory.AddCard(card);
OnCardCollected?.Invoke(card); OnCardCollected?.Invoke(card);
Debug.Log($"[CardSystemManager] Added new card '{card.Name}' to collection."); Logging.Debug($"[CardSystemManager] Added new card '{card.Name}' to collection.");
} }
} }
@@ -197,7 +198,7 @@ namespace Data.CardSystem
else else
{ {
// Fallback if no cards of the selected rarity // Fallback if no cards of the selected rarity
Debug.LogWarning($"[CardSystemManager] No cards of rarity {rarity} available, selecting a random card instead."); Logging.Warning($"[CardSystemManager] No cards of rarity {rarity} available, selecting a random card instead.");
int randomIndex = UnityEngine.Random.Range(0, availableCards.Count); int randomIndex = UnityEngine.Random.Range(0, availableCards.Count);
CardDefinition randomDef = availableCards[randomIndex]; CardDefinition randomDef = availableCards[randomIndex];

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Core;
using UnityEngine; using UnityEngine;
namespace AppleHills.Data.CardSystem namespace AppleHills.Data.CardSystem
@@ -86,7 +87,7 @@ namespace AppleHills.Data.CardSystem
return color; return color;
} }
Debug.LogWarning($"[CardVisualConfig] No color mapping found for rarity {rarity}, using default"); Logging.Warning($"[CardVisualConfig] No color mapping found for rarity {rarity}, using default");
return Color.white; return Color.white;
} }
@@ -107,7 +108,7 @@ namespace AppleHills.Data.CardSystem
return color; return color;
} }
Debug.LogWarning($"[CardVisualConfig] No color mapping found for zone {zone}, using default"); Logging.Warning($"[CardVisualConfig] No color mapping found for zone {zone}, using default");
return Color.white; return Color.white;
} }
@@ -128,7 +129,7 @@ namespace AppleHills.Data.CardSystem
return sprite; return sprite;
} }
Debug.LogWarning($"[CardVisualConfig] No shape mapping found for zone {zone}"); Logging.Warning($"[CardVisualConfig] No shape mapping found for zone {zone}");
return null; return null;
} }

View File

@@ -89,7 +89,7 @@ namespace Dialogue
speechBubble.DisplayDialogueContent(content, HasAnyLines()); speechBubble.DisplayDialogueContent(content, HasAnyLines());
// Log the content type for debugging // Log the content type for debugging
Debug.Log($"Displaying content type: {content.ContentType} - {(content.ContentType == DialogueContentType.Text ? content.Text : content.Image?.name)}"); Logging.Debug($"Displaying content type: {content.ContentType} - {(content.ContentType == DialogueContentType.Text ? content.Text : content.Image?.name)}");
} }
else else
{ {
@@ -98,7 +98,7 @@ namespace Dialogue
speechBubble.DisplayDialogueLine(line, HasAnyLines()); speechBubble.DisplayDialogueLine(line, HasAnyLines());
// Log for debugging // Log for debugging
Debug.Log($"Displaying legacy text: {line}"); Logging.Debug($"Displaying legacy text: {line}");
} }
} }
@@ -345,7 +345,7 @@ namespace Dialogue
private void MoveToNextNode() private void MoveToNextNode()
{ {
Debug.Log("MoveToNextNode"); Logging.Debug("MoveToNextNode");
// If there's no next node, complete the dialogue // If there's no next node, complete the dialogue
if (string.IsNullOrEmpty(currentNode.nextNodeID)) if (string.IsNullOrEmpty(currentNode.nextNodeID))
@@ -471,7 +471,7 @@ namespace Dialogue
private void OnAnyItemSlotted(PickupItemData slotDefinition, PickupItemData slottedItem) private void OnAnyItemSlotted(PickupItemData slotDefinition, PickupItemData slottedItem)
{ {
Debug.Log("[DialogueComponent] OnAnyItemSlotted"); Logging.Debug("[DialogueComponent] OnAnyItemSlotted");
// Only react if we're active and waiting on a slot // Only react if we're active and waiting on a slot
if (!IsActive || IsCompleted || currentNode == null || if (!IsActive || IsCompleted || currentNode == null ||

View File

@@ -1,5 +1,6 @@
using UnityEngine; using UnityEngine;
using AppleHills.Core; using AppleHills.Core;
using Core;
namespace AppleHills.Examples namespace AppleHills.Examples
{ {
@@ -17,64 +18,64 @@ namespace AppleHills.Examples
// Print info about the player // Print info about the player
if (player != null) if (player != null)
{ {
Debug.Log($"[QuickAccessExample] Player found: {player.name}"); Logging.Debug($"[QuickAccessExample] Player found: {player.name}");
Debug.Log($"[QuickAccessExample] Player position: {player.transform.position}"); Logging.Debug($"[QuickAccessExample] Player position: {player.transform.position}");
// Access player controller // Access player controller
var playerController = QuickAccess.Instance.PlayerController; var playerController = QuickAccess.Instance.PlayerController;
if (playerController != null) if (playerController != null)
{ {
Debug.Log($"[QuickAccessExample] Player controller found on object"); Logging.Debug($"[QuickAccessExample] Player controller found on object");
} }
else else
{ {
Debug.LogWarning($"[QuickAccessExample] Player controller not found"); Logging.Warning($"[QuickAccessExample] Player controller not found");
} }
} }
else else
{ {
Debug.LogWarning($"[QuickAccessExample] Player not found in scene"); Logging.Warning($"[QuickAccessExample] Player not found in scene");
} }
// Print info about the follower (Pulver) // Print info about the follower (Pulver)
if (follower != null) if (follower != null)
{ {
Debug.Log($"[QuickAccessExample] Follower found: {follower.name}"); Logging.Debug($"[QuickAccessExample] Follower found: {follower.name}");
Debug.Log($"[QuickAccessExample] Follower position: {follower.transform.position}"); Logging.Debug($"[QuickAccessExample] Follower position: {follower.transform.position}");
// Access follower controller // Access follower controller
var followerController = QuickAccess.Instance.FollowerController; var followerController = QuickAccess.Instance.FollowerController;
if (followerController != null) if (followerController != null)
{ {
Debug.Log($"[QuickAccessExample] Follower controller found on object"); Logging.Debug($"[QuickAccessExample] Follower controller found on object");
} }
else else
{ {
Debug.LogWarning($"[QuickAccessExample] Follower controller not found"); Logging.Warning($"[QuickAccessExample] Follower controller not found");
} }
} }
else else
{ {
Debug.LogWarning($"[QuickAccessExample] Follower not found in scene"); Logging.Warning($"[QuickAccessExample] Follower not found in scene");
} }
// Access camera // Access camera
var camera = QuickAccess.Instance.MainCamera; var camera = QuickAccess.Instance.MainCamera;
if (camera != null) if (camera != null)
{ {
Debug.Log($"[QuickAccessExample] Main camera found: {camera.name}"); Logging.Debug($"[QuickAccessExample] Main camera found: {camera.name}");
Debug.Log($"[QuickAccessExample] Camera position: {camera.transform.position}"); Logging.Debug($"[QuickAccessExample] Camera position: {camera.transform.position}");
} }
else else
{ {
Debug.LogWarning($"[QuickAccessExample] Main camera not found"); Logging.Warning($"[QuickAccessExample] Main camera not found");
} }
// Access managers // Access managers
try try
{ {
Debug.Log($"[QuickAccessExample] Game Manager instance accessed: {QuickAccess.Instance.GameManager != null}"); Logging.Debug($"[QuickAccessExample] Game Manager instance accessed: {QuickAccess.Instance.GameManager != null}");
Debug.Log($"[QuickAccessExample] Input Manager instance accessed: {QuickAccess.Instance.InputManager != null}"); Logging.Debug($"[QuickAccessExample] Input Manager instance accessed: {QuickAccess.Instance.InputManager != null}");
} }
catch (System.Exception e) catch (System.Exception e)
{ {

View File

@@ -4,7 +4,8 @@ using UnityEngine;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
using UnityEngine.InputSystem; using UnityEngine.InputSystem;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
using AppleHills.Core.Settings; // Added for IInteractionSettings using AppleHills.Core.Settings;
using Core; // Added for IInteractionSettings
namespace Input namespace Input
{ {
@@ -89,12 +90,12 @@ namespace Input
{ {
if (sceneName.ToLower().Contains("mainmenu")) if (sceneName.ToLower().Contains("mainmenu"))
{ {
Debug.Log("[InputManager] SwitchInputOnSceneLoaded - Setting InputMode to UI for MainMenu"); Logging.Debug("[InputManager] SwitchInputOnSceneLoaded - Setting InputMode to UI for MainMenu");
SetInputMode(InputMode.GameAndUI); SetInputMode(InputMode.GameAndUI);
} }
else else
{ {
Debug.Log("[InputManager] SwitchInputOnSceneLoaded - Setting InputMode to PlayerTouch"); Logging.Debug("[InputManager] SwitchInputOnSceneLoaded - Setting InputMode to PlayerTouch");
SetInputMode(InputMode.GameAndUI); SetInputMode(InputMode.GameAndUI);
} }
} }
@@ -165,24 +166,24 @@ namespace Input
Vector2 screenPos = positionAction.ReadValue<Vector2>(); Vector2 screenPos = positionAction.ReadValue<Vector2>();
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos); Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y); Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y);
Debug.Log($"[InputManager] TapMove performed at {worldPos2D}"); Logging.Debug($"[InputManager] TapMove performed at {worldPos2D}");
// First try to delegate to an override consumer if available // First try to delegate to an override consumer if available
if (TryDelegateToOverrideConsumer(screenPos, worldPos2D)) if (TryDelegateToOverrideConsumer(screenPos, worldPos2D))
{ {
Debug.Log("[InputManager] Tap delegated to override consumer"); Logging.Debug("[InputManager] Tap delegated to override consumer");
return; return;
} }
// Then try to delegate to any ITouchInputConsumer (UI or world interactable) // Then try to delegate to any ITouchInputConsumer (UI or world interactable)
if (!TryDelegateToAnyInputConsumer(screenPos, worldPos2D)) if (!TryDelegateToAnyInputConsumer(screenPos, worldPos2D))
{ {
Debug.Log("[InputManager] No input consumer found, forwarding tap to default consumer"); Logging.Debug("[InputManager] No input consumer found, forwarding tap to default consumer");
defaultConsumer?.OnTap(worldPos2D); defaultConsumer?.OnTap(worldPos2D);
} }
else else
{ {
Debug.Log("[InputManager] Tap delegated to input consumer"); Logging.Debug("[InputManager] Tap delegated to input consumer");
} }
} }
@@ -195,13 +196,13 @@ namespace Input
Vector2 screenPos = positionAction.ReadValue<Vector2>(); Vector2 screenPos = positionAction.ReadValue<Vector2>();
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos); Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y); Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y);
Debug.Log($"[InputManager] HoldMove started at {worldPos2D}"); Logging.Debug($"[InputManager] HoldMove started at {worldPos2D}");
// First check for override consumers // First check for override consumers
if (_overrideConsumers.Count > 0) if (_overrideConsumers.Count > 0)
{ {
_activeHoldConsumer = _overrideConsumers[_overrideConsumers.Count - 1]; _activeHoldConsumer = _overrideConsumers[_overrideConsumers.Count - 1];
Debug.Log($"[InputManager] Hold delegated to override consumer: {_activeHoldConsumer}"); Logging.Debug($"[InputManager] Hold delegated to override consumer: {_activeHoldConsumer}");
_activeHoldConsumer.OnHoldStart(worldPos2D); _activeHoldConsumer.OnHoldStart(worldPos2D);
return; return;
} }
@@ -221,7 +222,7 @@ namespace Input
Vector2 screenPos = positionAction.ReadValue<Vector2>(); Vector2 screenPos = positionAction.ReadValue<Vector2>();
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos); Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y); Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y);
Debug.Log($"[InputManager] HoldMove canceled at {worldPos2D}"); Logging.Debug($"[InputManager] HoldMove canceled at {worldPos2D}");
// Notify the active hold consumer that the hold has ended // Notify the active hold consumer that the hold has ended
_activeHoldConsumer?.OnHoldEnd(worldPos2D); _activeHoldConsumer?.OnHoldEnd(worldPos2D);
@@ -238,7 +239,7 @@ namespace Input
Vector2 screenPos = positionAction.ReadValue<Vector2>(); Vector2 screenPos = positionAction.ReadValue<Vector2>();
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos); Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y); Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y);
// Debug.Log($"[InputManager] HoldMove update at {worldPos2D}"); // Logging.Debug($"[InputManager] HoldMove update at {worldPos2D}");
// Send hold move updates to the active hold consumer // Send hold move updates to the active hold consumer
_activeHoldConsumer?.OnHoldMove(worldPos2D); _activeHoldConsumer?.OnHoldMove(worldPos2D);
@@ -285,7 +286,7 @@ namespace Input
} }
if (consumer != null) if (consumer != null)
{ {
Debug.unityLogger.Log("Interactable", $"[InputManager] Delegating tap to UI consumer at {screenPos} (GameObject: {result.gameObject.name})"); Logging.Debug($"[InputManager] Delegating tap to UI consumer at {screenPos} (GameObject: {result.gameObject.name})");
consumer.OnTap(screenPos); consumer.OnTap(screenPos);
return true; return true;
} }
@@ -314,7 +315,7 @@ namespace Input
} }
if (consumer != null) if (consumer != null)
{ {
Debug.unityLogger.Log("Interactable", $"[InputManager] Delegating tap to consumer at {worldPos} (GameObject: {hitWithMask.gameObject.name})"); Logging.Debug($"[InputManager] Delegating tap to consumer at {worldPos} (GameObject: {hitWithMask.gameObject.name})");
consumer.OnTap(worldPos); consumer.OnTap(worldPos);
return true; return true;
} }
@@ -328,15 +329,15 @@ namespace Input
var consumer = hit.GetComponent<ITouchInputConsumer>(); var consumer = hit.GetComponent<ITouchInputConsumer>();
if (consumer != null) if (consumer != null)
{ {
Debug.unityLogger.Log("Interactable", $"[InputManager] Delegating tap to consumer at {worldPos} (GameObject: {hit.gameObject.name})"); Logging.Debug($"[InputManager] Delegating tap to consumer at {worldPos} (GameObject: {hit.gameObject.name})");
consumer.OnTap(worldPos); consumer.OnTap(worldPos);
return true; return true;
} }
Debug.unityLogger.Log("Interactable", $"[InputManager] Collider2D hit at {worldPos} (GameObject: {hit.gameObject.name}), but no ITouchInputConsumer found."); Logging.Debug($"[InputManager] Collider2D hit at {worldPos} (GameObject: {hit.gameObject.name}), but no ITouchInputConsumer found.");
} }
else else
{ {
Debug.unityLogger.Log("Interactable", $"[InputManager] No Collider2D found at {worldPos} for interactable delegation."); Logging.Debug($"[InputManager] No Collider2D found at {worldPos} for interactable delegation.");
} }
return false; return false;
} }
@@ -351,7 +352,7 @@ namespace Input
return; return;
_overrideConsumers.Add(consumer); _overrideConsumers.Add(consumer);
Debug.Log($"[InputManager] Override consumer registered: {consumer}"); Logging.Debug($"[InputManager] Override consumer registered: {consumer}");
} }
/// <summary> /// <summary>
@@ -369,7 +370,7 @@ namespace Input
} }
_overrideConsumers.Remove(consumer); _overrideConsumers.Remove(consumer);
Debug.Log($"[InputManager] Override consumer unregistered: {consumer}"); Logging.Debug($"[InputManager] Override consumer unregistered: {consumer}");
} }
/// <summary> /// <summary>
@@ -379,7 +380,7 @@ namespace Input
{ {
_activeHoldConsumer = null; _activeHoldConsumer = null;
_overrideConsumers.Clear(); _overrideConsumers.Clear();
Debug.Log("[InputManager] All override consumers cleared."); Logging.Debug("[InputManager] All override consumers cleared.");
} }
/// <summary> /// <summary>
@@ -392,7 +393,7 @@ namespace Input
// Get the topmost override consumer (last registered) // Get the topmost override consumer (last registered)
var consumer = _overrideConsumers[_overrideConsumers.Count - 1]; var consumer = _overrideConsumers[_overrideConsumers.Count - 1];
Debug.unityLogger.Log("Interactable", $"[InputManager] Delegating tap to override consumer at {worldPos} (GameObject: {consumer})"); Logging.Debug($"[InputManager] Delegating tap to override consumer at {worldPos} (GameObject: {consumer})");
consumer.OnTap(worldPos); consumer.OnTap(worldPos);
return true; return true;
} }

View File

@@ -1,6 +1,7 @@
using UnityEngine; using UnityEngine;
using Pathfinding; using Pathfinding;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core;
namespace Input namespace Input
{ {
@@ -83,7 +84,7 @@ namespace Input
public void OnTap(Vector2 worldPosition) public void OnTap(Vector2 worldPosition)
{ {
InterruptMoveTo(); InterruptMoveTo();
Debug.Log($"[PlayerTouchController] OnTap at {worldPosition}"); Logging.Debug($"[PlayerTouchController] OnTap at {worldPosition}");
if (aiPath != null) if (aiPath != null)
{ {
aiPath.enabled = true; aiPath.enabled = true;
@@ -102,7 +103,7 @@ namespace Input
public void OnHoldStart(Vector2 worldPosition) public void OnHoldStart(Vector2 worldPosition)
{ {
InterruptMoveTo(); InterruptMoveTo();
Debug.Log($"[PlayerTouchController] OnHoldStart at {worldPosition}"); Logging.Debug($"[PlayerTouchController] OnHoldStart at {worldPosition}");
lastHoldPosition = worldPosition; lastHoldPosition = worldPosition;
isHolding = true; isHolding = true;
if (_settings.DefaultHoldMovementMode == HoldMovementMode.Pathfinding && if (_settings.DefaultHoldMovementMode == HoldMovementMode.Pathfinding &&
@@ -139,7 +140,7 @@ namespace Input
/// </summary> /// </summary>
public void OnHoldEnd(Vector2 worldPosition) public void OnHoldEnd(Vector2 worldPosition)
{ {
Debug.Log($"[PlayerTouchController] OnHoldEnd at {worldPosition}"); Logging.Debug($"[PlayerTouchController] OnHoldEnd at {worldPosition}");
isHolding = false; isHolding = false;
directMoveVelocity = Vector3.zero; directMoveVelocity = Vector3.zero;
if (aiPath != null && _settings.DefaultHoldMovementMode == if (aiPath != null && _settings.DefaultHoldMovementMode ==
@@ -315,13 +316,13 @@ namespace Input
{ {
_isMoving = true; _isMoving = true;
OnMovementStarted?.Invoke(); OnMovementStarted?.Invoke();
Debug.Log("[PlayerTouchController] Movement started"); Logging.Debug("[PlayerTouchController] Movement started");
} }
else if (!isCurrentlyMoving && _isMoving) else if (!isCurrentlyMoving && _isMoving)
{ {
_isMoving = false; _isMoving = false;
OnMovementStopped?.Invoke(); OnMovementStopped?.Invoke();
Debug.Log("[PlayerTouchController] Movement stopped"); Logging.Debug("[PlayerTouchController] Movement stopped");
} }
} }

View File

@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine.Events; using UnityEngine.Events;
using System.Threading.Tasks; using System.Threading.Tasks;
using Core;
namespace Interactions namespace Interactions
{ {
@@ -100,10 +101,10 @@ namespace Interactions
{ {
if (!_isActive) if (!_isActive)
{ {
Debug.Log($"[Interactable] Is disabled!"); Logging.Debug($"[Interactable] Is disabled!");
return; return;
} }
Debug.Log($"[Interactable] OnTap at {worldPosition} on {gameObject.name}"); Logging.Debug($"[Interactable] OnTap at {worldPosition} on {gameObject.name}");
// Start the interaction process asynchronously // Start the interaction process asynchronously
_ = TryInteractAsync(); _ = TryInteractAsync();
@@ -129,7 +130,7 @@ namespace Interactions
{ {
if (_playerRef == null) if (_playerRef == null)
{ {
Debug.Log($"[Interactable] Player character could not be found. Aborting interaction."); Logging.Debug($"[Interactable] Player character could not be found. Aborting interaction.");
interactionInterrupted.Invoke(); interactionInterrupted.Invoke();
await DispatchEventAsync(InteractionEventType.InteractionInterrupted); await DispatchEventAsync(InteractionEventType.InteractionInterrupted);
return; return;
@@ -372,9 +373,9 @@ namespace Interactions
// Dispatch InteractingCharacterArrived event and WAIT for all actions to complete // Dispatch InteractingCharacterArrived event and WAIT for all actions to complete
// This ensures we wait for any timeline animations to finish before proceeding // This ensures we wait for any timeline animations to finish before proceeding
Debug.Log("[Interactable] Follower arrived, dispatching InteractingCharacterArrived event and waiting for completion"); Logging.Debug("[Interactable] Follower arrived, dispatching InteractingCharacterArrived event and waiting for completion");
await DispatchEventAsync(InteractionEventType.InteractingCharacterArrived); await DispatchEventAsync(InteractionEventType.InteractingCharacterArrived);
Debug.Log("[Interactable] All InteractingCharacterArrived actions completed, proceeding with interaction"); Logging.Debug("[Interactable] All InteractingCharacterArrived actions completed, proceeding with interaction");
// Check if we have any components that might have paused the interaction flow // Check if we have any components that might have paused the interaction flow
bool hasTimelineActions = false; bool hasTimelineActions = false;

View File

@@ -3,6 +3,7 @@ using UnityEngine;
using UnityEngine.Playables; using UnityEngine.Playables;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Core;
using Input; using Input;
namespace Interactions namespace Interactions
@@ -156,7 +157,7 @@ namespace Interactions
{ {
if (timelineAsset == null) if (timelineAsset == null)
{ {
Debug.LogWarning("[InteractionTimelineAction] Timeline asset is null"); Logging.Warning("[InteractionTimelineAction] Timeline asset is null");
return true; // Return true to continue the interaction flow return true; // Return true to continue the interaction flow
} }
@@ -175,7 +176,7 @@ namespace Interactions
} }
else else
{ {
Debug.LogWarning($"[InteractionTimelineAction] Could not find track named '{mapping.playerTrackName}' for player binding"); Logging.Warning($"[InteractionTimelineAction] Could not find track named '{mapping.playerTrackName}' for player binding");
} }
} }
catch (Exception ex) catch (Exception ex)
@@ -195,7 +196,7 @@ namespace Interactions
} }
else else
{ {
Debug.LogWarning($"[InteractionTimelineAction] Could not find track named '{mapping.pulverTrackName}' for follower binding"); Logging.Warning($"[InteractionTimelineAction] Could not find track named '{mapping.pulverTrackName}' for follower binding");
} }
} }
catch (Exception ex) catch (Exception ex)
@@ -212,7 +213,7 @@ namespace Interactions
playableDirector.stopped += OnPlayableDirectorStopped; playableDirector.stopped += OnPlayableDirectorStopped;
// Log the timeline playback // Log the timeline playback
Debug.Log($"[InteractionTimelineAction] Playing timeline {timelineAsset.name} for event {mapping.eventType}"); Logging.Debug($"[InteractionTimelineAction] Playing timeline {timelineAsset.name} for event {mapping.eventType}");
// Play the timeline // Play the timeline
playableDirector.Play(); playableDirector.Play();
@@ -224,7 +225,7 @@ namespace Interactions
bool result = await _currentPlaybackTCS.Task; bool result = await _currentPlaybackTCS.Task;
// Log completion // Log completion
Debug.Log($"[InteractionTimelineAction] Timeline {timelineAsset.name} playback completed with result: {result}"); Logging.Debug($"[InteractionTimelineAction] Timeline {timelineAsset.name} playback completed with result: {result}");
// Clear the task completion source // Clear the task completion source
_currentPlaybackTCS = null; _currentPlaybackTCS = null;
@@ -237,7 +238,7 @@ namespace Interactions
if (director != playableDirector || _currentPlaybackTCS == null) if (director != playableDirector || _currentPlaybackTCS == null)
return; return;
Debug.Log($"[InteractionTimelineAction] PlayableDirector stopped. Signaling completion."); Logging.Debug($"[InteractionTimelineAction] PlayableDirector stopped. Signaling completion.");
// Signal completion when the director stops // Signal completion when the director stops
_currentPlaybackTCS.TrySetResult(true); _currentPlaybackTCS.TrySetResult(true);
@@ -250,7 +251,7 @@ namespace Interactions
// If the TCS still exists after timeout, complete it with failure // If the TCS still exists after timeout, complete it with failure
if (_currentPlaybackTCS != null) if (_currentPlaybackTCS != null)
{ {
Debug.LogWarning($"[InteractionTimelineAction] Timeline playback timed out after {timeoutDuration} seconds"); Logging.Warning($"[InteractionTimelineAction] Timeline playback timed out after {timeoutDuration} seconds");
_currentPlaybackTCS.TrySetResult(false); _currentPlaybackTCS.TrySetResult(false);
} }
} }

View File

@@ -80,7 +80,7 @@ namespace Interactions
protected override void OnCharacterArrived() protected override void OnCharacterArrived()
{ {
Debug.Log("[ItemSlot] OnCharacterArrived"); Logging.Debug("[ItemSlot] OnCharacterArrived");
var heldItemData = FollowerController.CurrentlyHeldItemData; var heldItemData = FollowerController.CurrentlyHeldItemData;
var heldItemObj = FollowerController.GetHeldPickupObject(); var heldItemObj = FollowerController.GetHeldPickupObject();

View File

@@ -103,7 +103,7 @@ namespace Interactions
protected virtual void OnCharacterArrived() protected virtual void OnCharacterArrived()
{ {
Debug.Log("[Pickup] OnCharacterArrived"); Logging.Debug("[Pickup] OnCharacterArrived");
var combinationResult = FollowerController.TryCombineItems(this, out var combinationResultItem); var combinationResult = FollowerController.TryCombineItems(this, out var combinationResultItem);
if (combinationResultItem != null) if (combinationResultItem != null)

View File

@@ -116,7 +116,7 @@ namespace LevelS
private async void OnMenuConfirm() private async void OnMenuConfirm()
{ {
var progress = new Progress<float>(p => Debug.Log($"Loading progress: {p * 100:F0}%")); var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
await SceneManagerService.Instance.SwitchSceneAsync(switchData.targetLevelSceneName, progress); await SceneManagerService.Instance.SwitchSceneAsync(switchData.targetLevelSceneName, progress);
} }

View File

@@ -2,6 +2,7 @@
using System.Collections; using System.Collections;
using Pooling; using Pooling;
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using Core;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -72,7 +73,7 @@ namespace Minigames.DivingForPictures
StopBubbleBehavior(); StopBubbleBehavior();
// Debug log for troubleshooting // Debug log for troubleshooting
Debug.Log($"[Bubble] Paused bubble: {name}"); Logging.Debug($"[Bubble] Paused bubble: {name}");
} }
/// <summary> /// <summary>
@@ -86,7 +87,7 @@ namespace Minigames.DivingForPictures
StartBubbleBehavior(); StartBubbleBehavior();
// Debug log for troubleshooting // Debug log for troubleshooting
Debug.Log($"[Bubble] Resumed bubble: {name}"); Logging.Debug($"[Bubble] Resumed bubble: {name}");
} }
/// <summary> /// <summary>
@@ -195,7 +196,7 @@ namespace Minigames.DivingForPictures
BubblePool pool = FindFirstObjectByType<BubblePool>(); BubblePool pool = FindFirstObjectByType<BubblePool>();
if (pool != null) if (pool != null)
{ {
Debug.LogWarning("Bubble is missing its parent pool reference, finding pool as fallback"); Logging.Warning("Bubble is missing its parent pool reference, finding pool as fallback");
pool.ReturnBubble(this); pool.ReturnBubble(this);
} }
else else

View File

@@ -1,4 +1,5 @@
using UnityEngine; using Core;
using UnityEngine;
using Pooling; using Pooling;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
@@ -36,7 +37,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
public override void LogPoolStats() public override void LogPoolStats()
{ {
Debug.Log($"[BubblePool] Pooled bubbles: {pooledObjects.Count}/{maxPoolSize} (Created: {totalCreated}, Returned: {totalReturned})"); Logging.Debug($"[BubblePool] Pooled bubbles: {pooledObjects.Count}/{maxPoolSize} (Created: {totalCreated}, Returned: {totalReturned})");
} }
} }
} }

View File

@@ -2,6 +2,7 @@
using UnityEngine; using UnityEngine;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using Core;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -106,7 +107,7 @@ namespace Minigames.DivingForPictures
} }
} }
Debug.Log("[BubbleSpawner] Paused"); Logging.Debug("[BubbleSpawner] Paused");
} }
/// <summary> /// <summary>
@@ -131,7 +132,7 @@ namespace Minigames.DivingForPictures
} }
} }
Debug.Log("[BubbleSpawner] Resumed"); Logging.Debug("[BubbleSpawner] Resumed");
} }
/// <summary> /// <summary>
@@ -153,7 +154,7 @@ namespace Minigames.DivingForPictures
if (_devSettings == null) return; if (_devSettings == null) return;
_nextSpawnInterval = GetRandomizedInterval(); _nextSpawnInterval = GetRandomizedInterval();
Debug.Log($"[BubbleSpawner] Next spawn interval set to: {_nextSpawnInterval:F2}s"); Logging.Debug($"[BubbleSpawner] Next spawn interval set to: {_nextSpawnInterval:F2}s");
} }
/// <summary> /// <summary>
@@ -239,7 +240,7 @@ namespace Minigames.DivingForPictures
bubble.speed *= _devSettings.BubbleSurfacingSpeedFactor; bubble.speed *= _devSettings.BubbleSurfacingSpeedFactor;
} }
Debug.Log($"[BubbleSpawner] Started surfacing mode. Bubbles slowed to {_devSettings.BubbleSurfacingSpeedFactor * 100}% speed."); Logging.Debug($"[BubbleSpawner] Started surfacing mode. Bubbles slowed to {_devSettings.BubbleSurfacingSpeedFactor * 100}% speed.");
} }
/// <summary> /// <summary>
@@ -258,7 +259,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
private IEnumerator SpawnBubblesRoutine() private IEnumerator SpawnBubblesRoutine()
{ {
Debug.Log("[BubbleSpawner] Started bubble spawning coroutine"); Logging.Debug("[BubbleSpawner] Started bubble spawning coroutine");
while (enabled && gameObject.activeInHierarchy && !_isPaused) while (enabled && gameObject.activeInHierarchy && !_isPaused)
{ {
@@ -269,7 +270,7 @@ namespace Minigames.DivingForPictures
_spawnCoroutine = null; _spawnCoroutine = null;
Debug.Log("[BubbleSpawner] Bubble spawning coroutine ended"); Logging.Debug("[BubbleSpawner] Bubble spawning coroutine ended");
} }
} }
} }

View File

@@ -8,6 +8,7 @@ using UnityEngine.Playables;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Utility; using Utility;
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using Core;
using Input; using Input;
using UI; using UI;
using Minigames.DivingForPictures.PictureCamera; using Minigames.DivingForPictures.PictureCamera;
@@ -144,11 +145,11 @@ namespace Minigames.DivingForPictures
pauseMenu.OnGamePaused += Pause; pauseMenu.OnGamePaused += Pause;
pauseMenu.OnGameResumed += DoResume; pauseMenu.OnGameResumed += DoResume;
Debug.Log("[DivingGameManager] Subscribed to PauseMenu events"); Logging.Debug("[DivingGameManager] Subscribed to PauseMenu events");
} }
else else
{ {
Debug.LogWarning("[DivingGameManager] PauseMenu not found. Pause functionality won't work properly."); Logging.Warning("[DivingGameManager] PauseMenu not found. Pause functionality won't work properly.");
} }
// Register this manager with the global GameManager // Register this manager with the global GameManager
@@ -161,6 +162,7 @@ namespace Minigames.DivingForPictures
if (SceneOrientationEnforcer.Instance != null) if (SceneOrientationEnforcer.Instance != null)
{ {
SceneOrientationEnforcer.Instance.OnOrientationCorrect += InitializeGame; SceneOrientationEnforcer.Instance.OnOrientationCorrect += InitializeGame;
SceneOrientationEnforcer.Instance.OnOrientationIncorrect += Pause;
// If orientation is already correct, initialize right away // If orientation is already correct, initialize right away
// This prevents issues if the orientation was already correct before subscription // This prevents issues if the orientation was already correct before subscription
@@ -171,7 +173,7 @@ namespace Minigames.DivingForPictures
} }
else else
{ {
Debug.LogWarning("[DivingGameManager] SceneOrientationEnforcer not found. Initializing game immediately."); Logging.Warning("[DivingGameManager] SceneOrientationEnforcer not found. Initializing game immediately.");
InitializeGame(); InitializeGame();
} }
@@ -210,6 +212,7 @@ namespace Minigames.DivingForPictures
if (SceneOrientationEnforcer.Instance != null) if (SceneOrientationEnforcer.Instance != null)
{ {
SceneOrientationEnforcer.Instance.OnOrientationCorrect -= InitializeGame; SceneOrientationEnforcer.Instance.OnOrientationCorrect -= InitializeGame;
SceneOrientationEnforcer.Instance.OnOrientationIncorrect -= Pause;
} }
// Unsubscribe from PauseMenu events // Unsubscribe from PauseMenu events
@@ -294,11 +297,11 @@ namespace Minigames.DivingForPictures
private void SpawnMonster(Transform spawnPoint) private void SpawnMonster(Transform spawnPoint)
{ {
Debug.Log("Spawning monster: " + spawnPoint.name); Logging.Debug("Spawning monster: " + spawnPoint.name);
if (monsterPrefabs.Length == 0) if (monsterPrefabs.Length == 0)
{ {
Debug.LogWarning("No monster prefabs assigned to DivingGameManager."); Logging.Warning("No monster prefabs assigned to DivingGameManager.");
return; return;
} }
@@ -359,7 +362,7 @@ namespace Minigames.DivingForPictures
int remainingRopes = playerRopes.Length - currentRopeIndex; int remainingRopes = playerRopes.Length - currentRopeIndex;
OnRopeBroken?.Invoke(remainingRopes); OnRopeBroken?.Invoke(remainingRopes);
Debug.Log($"[DivingGameManager] Rope broken! {remainingRopes} ropes remaining."); Logging.Debug($"[DivingGameManager] Rope broken! {remainingRopes} ropes remaining.");
} }
} }
@@ -379,7 +382,7 @@ namespace Minigames.DivingForPictures
} }
else else
{ {
Debug.LogWarning($"[DivingGameManager] Rope at index {currentRopeIndex} is null!"); Logging.Warning($"[DivingGameManager] Rope at index {currentRopeIndex} is null!");
} }
// Move to the next rope regardless if current was null // Move to the next rope regardless if current was null
@@ -406,7 +409,7 @@ namespace Minigames.DivingForPictures
if (isGameOver) return; if (isGameOver) return;
isGameOver = true; isGameOver = true;
Debug.Log("[DivingGameManager] Game Over! All ropes broken. Starting surfacing sequence..."); Logging.Debug("[DivingGameManager] Game Over! All ropes broken. Starting surfacing sequence...");
// Fire game over event // Fire game over event
OnGameOver?.Invoke(); OnGameOver?.Invoke();
@@ -422,7 +425,7 @@ namespace Minigames.DivingForPictures
{ {
if (playerRopes == null || playerRopes.Length == 0) if (playerRopes == null || playerRopes.Length == 0)
{ {
Debug.LogWarning("[DivingGameManager] No ropes assigned to break! Damage system won't work properly."); Logging.Warning("[DivingGameManager] No ropes assigned to break! Damage system won't work properly.");
return; return;
} }
@@ -430,7 +433,7 @@ namespace Minigames.DivingForPictures
{ {
if (playerRopes[i] == null) if (playerRopes[i] == null)
{ {
Debug.LogWarning($"[DivingGameManager] Rope at index {i} is null!"); Logging.Warning($"[DivingGameManager] Rope at index {i} is null!");
} }
} }
} }
@@ -456,7 +459,7 @@ namespace Minigames.DivingForPictures
} }
} }
Debug.Log("[DivingGameManager] Rope system reset."); Logging.Debug("[DivingGameManager] Rope system reset.");
} }
/// <summary> /// <summary>
@@ -510,7 +513,7 @@ namespace Minigames.DivingForPictures
// Start coroutine to animate the rock falling offscreen // Start coroutine to animate the rock falling offscreen
StartCoroutine(MoveRockOffscreen(rockObject.transform)); StartCoroutine(MoveRockOffscreen(rockObject.transform));
Debug.Log("[DivingGameManager] Disabled rock components and animating it offscreen"); Logging.Debug("[DivingGameManager] Disabled rock components and animating it offscreen");
} }
// Handle the Player object - disable components and reset X position // Handle the Player object - disable components and reset X position
@@ -534,7 +537,7 @@ namespace Minigames.DivingForPictures
// Start coroutine to reset X position to 0 over 1 second // Start coroutine to reset X position to 0 over 1 second
StartCoroutine(ResetPlayerPosition(playerObject.transform)); StartCoroutine(ResetPlayerPosition(playerObject.transform));
Debug.Log("[DivingGameManager] Disabled player components (keeping Animator and PlayerBlinkBehavior) and resetting position"); Logging.Debug("[DivingGameManager] Disabled player components (keeping Animator and PlayerBlinkBehavior) and resetting position");
} }
// 3. Find bubble spawner and slow down existing bubbles (no velocity management needed) // 3. Find bubble spawner and slow down existing bubbles (no velocity management needed)
@@ -566,7 +569,7 @@ namespace Minigames.DivingForPictures
} }
surfacingSequenceCoroutine = StartCoroutine(SurfacingSequence()); surfacingSequenceCoroutine = StartCoroutine(SurfacingSequence());
Debug.Log($"[DivingGameManager] Started surfacing with target velocity factor: {targetVelocityFactor}"); Logging.Debug($"[DivingGameManager] Started surfacing with target velocity factor: {targetVelocityFactor}");
} }
/// <summary> /// <summary>
@@ -580,7 +583,7 @@ namespace Minigames.DivingForPictures
UnityEngine.Camera mainCamera = UnityEngine.Camera.main; UnityEngine.Camera mainCamera = UnityEngine.Camera.main;
if (mainCamera == null) if (mainCamera == null)
{ {
Debug.LogWarning("[DivingGameManager] Cannot find main camera to calculate offscreen position"); Logging.Warning("[DivingGameManager] Cannot find main camera to calculate offscreen position");
yield break; yield break;
} }
@@ -648,7 +651,7 @@ namespace Minigames.DivingForPictures
{ {
// Tell it to stop spawning new tiles // Tell it to stop spawning new tiles
tileSpawner.StopSpawning(); tileSpawner.StopSpawning();
Debug.Log("[DivingGameManager] Stopped spawning new tiles after delay"); Logging.Debug("[DivingGameManager] Stopped spawning new tiles after delay");
} }
} }
@@ -661,11 +664,11 @@ namespace Minigames.DivingForPictures
if (surfacingTimeline != null) if (surfacingTimeline != null)
{ {
surfacingTimeline.Play(); surfacingTimeline.Play();
Debug.Log("[DivingGameManager] Last tile left the screen, playing timeline"); Logging.Debug("[DivingGameManager] Last tile left the screen, playing timeline");
} }
else else
{ {
Debug.LogWarning("[DivingGameManager] No surfacing timeline assigned!"); Logging.Warning("[DivingGameManager] No surfacing timeline assigned!");
} }
} }
@@ -684,7 +687,7 @@ namespace Minigames.DivingForPictures
activeMonsters.Clear(); activeMonsters.Clear();
// Final score could be saved to player prefs or other persistence // Final score could be saved to player prefs or other persistence
Debug.Log($"Final Score: {playerScore}"); Logging.Debug($"Final Score: {playerScore}");
} }
/// <summary> /// <summary>
@@ -747,7 +750,7 @@ namespace Minigames.DivingForPictures
component.Pause(); component.Pause();
} }
Debug.Log($"[DivingGameManager] Registered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}"); Logging.Debug($"[DivingGameManager] Registered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}");
} }
} }
@@ -760,7 +763,7 @@ namespace Minigames.DivingForPictures
if (component != null && _pausableComponents.Contains(component)) if (component != null && _pausableComponents.Contains(component))
{ {
_pausableComponents.Remove(component); _pausableComponents.Remove(component);
Debug.Log($"[DivingGameManager] Unregistered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}"); Logging.Debug($"[DivingGameManager] Unregistered pausable component: {(component as MonoBehaviour)?.name ?? "Unknown"}");
} }
} }
@@ -788,7 +791,7 @@ namespace Minigames.DivingForPictures
if(turnOffGameInput) if(turnOffGameInput)
InputManager.Instance.SetInputMode(InputMode.UI); InputManager.Instance.SetInputMode(InputMode.UI);
Debug.Log($"[DivingGameManager] Game paused. Paused {_pausableComponents.Count} components."); Logging.Debug($"[DivingGameManager] Game paused. Paused {_pausableComponents.Count} components.");
} }
/// <summary> /// <summary>
@@ -809,7 +812,7 @@ namespace Minigames.DivingForPictures
// Change input mode to UI when menu is open // Change input mode to UI when menu is open
InputManager.Instance.SetInputMode(InputMode.GameAndUI); InputManager.Instance.SetInputMode(InputMode.GameAndUI);
Debug.Log($"[DivingGameManager] Game resumed. Resumed {_pausableComponents.Count} components."); Logging.Debug($"[DivingGameManager] Game resumed. Resumed {_pausableComponents.Count} components.");
} }
#region Photo Sequence Methods #region Photo Sequence Methods
@@ -819,7 +822,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
private void OnReverseAnimationStarted() private void OnReverseAnimationStarted()
{ {
Debug.Log("[DivingGameManager] Viewfinder animation entering reverse (zoom-out) phase"); Logging.Debug("[DivingGameManager] Viewfinder animation entering reverse (zoom-out) phase");
} }
/// <summary> /// <summary>
@@ -842,7 +845,7 @@ namespace Minigames.DivingForPictures
// Store the proximity value at the time of tap for scoring // Store the proximity value at the time of tap for scoring
_capturedProximity = proximity; _capturedProximity = proximity;
Debug.Log($"[DivingGameManager] Player tapped during animation! Proximity: {proximity:F2}"); Logging.Debug($"[DivingGameManager] Player tapped during animation! Proximity: {proximity:F2}");
// Take the picture at the current proximity // Take the picture at the current proximity
TakePicture(); TakePicture();
@@ -883,7 +886,7 @@ namespace Minigames.DivingForPictures
// Calculate total score // Calculate total score
int pointsAwarded = settings.BasePoints + proximityBonus + depthBonus; int pointsAwarded = settings.BasePoints + proximityBonus + depthBonus;
Debug.Log($"[DivingGameManager] Picture score calculation: base={proximityBonus} (proximity={proximity:F2}), " + Logging.Debug($"[DivingGameManager] Picture score calculation: base={proximityBonus} (proximity={proximity:F2}), " +
$"depth bonus={depthBonus}, total={pointsAwarded}"); $"depth bonus={depthBonus}, total={pointsAwarded}");
// Add score // Add score
@@ -932,7 +935,7 @@ namespace Minigames.DivingForPictures
_isPhotoSequenceActive = false; _isPhotoSequenceActive = false;
_currentPhotoTarget = null; _currentPhotoTarget = null;
Debug.Log($"[DivingGameManager] Completed photo sequence with proximity score: {_capturedProximity:F2}"); Logging.Debug($"[DivingGameManager] Completed photo sequence with proximity score: {_capturedProximity:F2}");
} }
/// <summary> /// <summary>
@@ -956,10 +959,16 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
public void InitializeGame() public void InitializeGame()
{ {
if (_isGameInitialized)
{
DoResume();
return;
}
// Prevent double initialization // Prevent double initialization
if (_isGameInitialized) return; if (_isGameInitialized) return;
Debug.Log("[DivingGameManager] Initializing game"); Logging.Debug("[DivingGameManager] Initializing game");
// Subscribe to tile spawned event // Subscribe to tile spawned event
TrenchTileSpawner tileSpawner = FindFirstObjectByType<TrenchTileSpawner>(); TrenchTileSpawner tileSpawner = FindFirstObjectByType<TrenchTileSpawner>();
@@ -969,7 +978,7 @@ namespace Minigames.DivingForPictures
} }
else else
{ {
Debug.LogWarning("No TrenchTileSpawner found in scene. Monster spawning won't work."); Logging.Warning("No TrenchTileSpawner found in scene. Monster spawning won't work.");
} }
// Mark as initialized // Mark as initialized
@@ -1021,7 +1030,7 @@ namespace Minigames.DivingForPictures
if (viewfinderManager != null) if (viewfinderManager != null)
{ {
viewfinderManager.ShowFullScreenViewfinder(); viewfinderManager.ShowFullScreenViewfinder();
Debug.Log($"[DivingGameManager] Player entered range of monster {monster.name}, showing full-screen viewfinder"); Logging.Debug($"[DivingGameManager] Player entered range of monster {monster.name}, showing full-screen viewfinder");
} }
} }
} }
@@ -1036,7 +1045,7 @@ namespace Minigames.DivingForPictures
if (viewfinderManager != null) if (viewfinderManager != null)
{ {
viewfinderManager.HideViewfinder(); viewfinderManager.HideViewfinder();
Debug.Log($"[DivingGameManager] Player exited range of monster {monster.name}, hiding viewfinder"); Logging.Debug($"[DivingGameManager] Player exited range of monster {monster.name}, hiding viewfinder");
} }
// Clear current target // Clear current target
@@ -1052,7 +1061,7 @@ namespace Minigames.DivingForPictures
{ {
// Pause the game immediately // Pause the game immediately
DoPause(false); DoPause(false);
Debug.Log($"[DivingGameManager] Pausing game before starting viewfinder animation"); Logging.Debug($"[DivingGameManager] Pausing game before starting viewfinder animation");
// Mark the photo sequence as active // Mark the photo sequence as active
_isPhotoSequenceActive = true; _isPhotoSequenceActive = true;
@@ -1070,7 +1079,7 @@ namespace Minigames.DivingForPictures
if (viewfinderManager != null) if (viewfinderManager != null)
{ {
viewfinderManager.StartViewfinderSequence(_currentPhotoTarget.transform); viewfinderManager.StartViewfinderSequence(_currentPhotoTarget.transform);
Debug.Log($"[DivingGameManager] Viewfinder tapped for monster {_currentPhotoTarget.name}, starting animation sequence"); Logging.Debug($"[DivingGameManager] Viewfinder tapped for monster {_currentPhotoTarget.name}, starting animation sequence");
} }
else else
{ {

View File

@@ -1,6 +1,7 @@
using UnityEngine; using UnityEngine;
using System; using System;
using System.Collections; using System.Collections;
using Core;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -29,7 +30,7 @@ namespace Minigames.DivingForPictures
private void Awake() private void Awake()
{ {
Debug.Log("Monster created: " + gameObject.name); Logging.Debug("Monster created: " + gameObject.name);
if (detectionCollider == null) if (detectionCollider == null)
detectionCollider = GetComponent<CircleCollider2D>(); detectionCollider = GetComponent<CircleCollider2D>();
@@ -48,7 +49,7 @@ namespace Minigames.DivingForPictures
private void OnDestroy() private void OnDestroy()
{ {
Debug.Log("Monster destroyed: " + gameObject.name); Logging.Debug("Monster destroyed: " + gameObject.name);
} }
private IEnumerator CheckIfOffScreen() private IEnumerator CheckIfOffScreen()

View File

@@ -4,6 +4,7 @@ using AppleHills.Core.Settings;
using Pooling; using Pooling;
using Utils; using Utils;
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using Core;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -84,7 +85,7 @@ namespace Minigames.DivingForPictures
_settings = GameManager.GetSettingsObject<IDivingMinigameSettings>(); _settings = GameManager.GetSettingsObject<IDivingMinigameSettings>();
if (_settings == null) if (_settings == null)
{ {
Debug.LogWarning("[FloatingObstacle] Could not retrieve settings, using default values"); Logging.Warning("[FloatingObstacle] Could not retrieve settings, using default values");
_baseMoveSpeed = moveSpeed; // Use the serialized value as fallback _baseMoveSpeed = moveSpeed; // Use the serialized value as fallback
} }
else else
@@ -95,7 +96,7 @@ namespace Minigames.DivingForPictures
// For variety, randomly assign a speed between min and max // For variety, randomly assign a speed between min and max
_baseMoveSpeed = Random.Range(minSpeed, maxSpeed); _baseMoveSpeed = Random.Range(minSpeed, maxSpeed);
Debug.Log($"[FloatingObstacle] Initialized with normalized speed: {_baseMoveSpeed} (range: {minSpeed}-{maxSpeed})"); Logging.Debug($"[FloatingObstacle] Initialized with normalized speed: {_baseMoveSpeed} (range: {minSpeed}-{maxSpeed})");
} }
// Calculate screen normalization factor // Calculate screen normalization factor
@@ -117,7 +118,7 @@ namespace Minigames.DivingForPictures
// Calculate normalization factor based on screen height // Calculate normalization factor based on screen height
_screenNormalizationFactor = Screen.height / referenceHeight; _screenNormalizationFactor = Screen.height / referenceHeight;
Debug.Log($"[FloatingObstacle] Screen normalization factor: {_screenNormalizationFactor} (Screen height: {Screen.height}, Reference: {referenceHeight})"); Logging.Debug($"[FloatingObstacle] Screen normalization factor: {_screenNormalizationFactor} (Screen height: {Screen.height}, Reference: {referenceHeight})");
} }
private void OnEnable() private void OnEnable()
@@ -147,7 +148,7 @@ namespace Minigames.DivingForPictures
_isPaused = true; _isPaused = true;
StopObstacleCoroutines(); StopObstacleCoroutines();
Debug.Log($"[FloatingObstacle] Paused obstacle: {name}"); Logging.Debug($"[FloatingObstacle] Paused obstacle: {name}");
} }
/// <summary> /// <summary>
@@ -160,7 +161,7 @@ namespace Minigames.DivingForPictures
_isPaused = false; _isPaused = false;
StartObstacleCoroutines(); StartObstacleCoroutines();
Debug.Log($"[FloatingObstacle] Resumed obstacle: {name}"); Logging.Debug($"[FloatingObstacle] Resumed obstacle: {name}");
} }
/// <summary> /// <summary>
@@ -221,7 +222,7 @@ namespace Minigames.DivingForPictures
_movementCoroutine = StartCoroutine(MovementCoroutine()); _movementCoroutine = StartCoroutine(MovementCoroutine());
} }
Debug.Log($"[FloatingObstacle] {gameObject.name} velocity factor updated to {_velocityFactor:F2}, normalized speed: {moveSpeed:F2}"); Logging.Debug($"[FloatingObstacle] {gameObject.name} velocity factor updated to {_velocityFactor:F2}, normalized speed: {moveSpeed:F2}");
} }
/// <summary> /// <summary>
@@ -229,7 +230,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
private IEnumerator MovementCoroutine() private IEnumerator MovementCoroutine()
{ {
Debug.Log($"[FloatingObstacle] Started movement coroutine with speed: {_baseMoveSpeed:F3}"); Logging.Debug($"[FloatingObstacle] Started movement coroutine with speed: {_baseMoveSpeed:F3}");
while (enabled && gameObject.activeInHierarchy) while (enabled && gameObject.activeInHierarchy)
{ {
@@ -273,7 +274,7 @@ namespace Minigames.DivingForPictures
if (_collider != null && _collider.enabled) if (_collider != null && _collider.enabled)
{ {
_collider.enabled = false; _collider.enabled = false;
Debug.Log($"[FloatingObstacle] Obstacle {gameObject.name} hit player - collider disabled"); Logging.Debug($"[FloatingObstacle] Obstacle {gameObject.name} hit player - collider disabled");
} }
} }
@@ -299,12 +300,12 @@ namespace Minigames.DivingForPictures
// Use a larger buffer to ensure obstacles are truly off-screen before returning to pool // Use a larger buffer to ensure obstacles are truly off-screen before returning to pool
if (transform.position.y > _screenTop + 5f) if (transform.position.y > _screenTop + 5f)
{ {
Debug.Log($"[FloatingObstacle] {gameObject.name} off-screen at Y:{transform.position.y:F2}, screen top:{_screenTop:F2}"); Logging.Debug($"[FloatingObstacle] {gameObject.name} off-screen at Y:{transform.position.y:F2}, screen top:{_screenTop:F2}");
ReturnToPool(); ReturnToPool();
} }
else if (transform.position.y < _screenBottom - 5f) // Added check for bottom screen edge else if (transform.position.y < _screenBottom - 5f) // Added check for bottom screen edge
{ {
Debug.Log($"[FloatingObstacle] {gameObject.name} below screen at Y:{transform.position.y:F2}, screen bottom:{_screenBottom:F2}"); Logging.Debug($"[FloatingObstacle] {gameObject.name} below screen at Y:{transform.position.y:F2}, screen bottom:{_screenBottom:F2}");
ReturnToPool(); ReturnToPool();
} }
} }
@@ -328,14 +329,14 @@ namespace Minigames.DivingForPictures
ObstacleSpawner foundSpawner = FindFirstObjectByType<ObstacleSpawner>(); ObstacleSpawner foundSpawner = FindFirstObjectByType<ObstacleSpawner>();
if (foundSpawner != null) if (foundSpawner != null)
{ {
Debug.LogWarning($"[FloatingObstacle] Obstacle {gameObject.name} lost spawner reference, found replacement spawner"); Logging.Warning($"[FloatingObstacle] Obstacle {gameObject.name} lost spawner reference, found replacement spawner");
spawner = foundSpawner; spawner = foundSpawner;
spawner.ReturnObstacleToPool(gameObject, prefabIndex); spawner.ReturnObstacleToPool(gameObject, prefabIndex);
} }
else else
{ {
// No spawner found - just deactivate the object instead of destroying it // No spawner found - just deactivate the object instead of destroying it
Debug.LogWarning($"[FloatingObstacle] No spawner found for {gameObject.name}, deactivating safely"); Logging.Warning($"[FloatingObstacle] No spawner found for {gameObject.name}, deactivating safely");
gameObject.SetActive(false); gameObject.SetActive(false);
// Move to a safe location to avoid interference // Move to a safe location to avoid interference
@@ -368,7 +369,7 @@ namespace Minigames.DivingForPictures
_collider.enabled = true; _collider.enabled = true;
} }
Debug.Log($"[FloatingObstacle] Obstacle {gameObject.name} spawned from pool"); Logging.Debug($"[FloatingObstacle] Obstacle {gameObject.name} spawned from pool");
// Note: Don't start coroutines here - OnEnable() will handle that when SetActive(true) is called // Note: Don't start coroutines here - OnEnable() will handle that when SetActive(true) is called
} }
@@ -387,7 +388,7 @@ namespace Minigames.DivingForPictures
_collider.enabled = true; _collider.enabled = true;
} }
Debug.Log($"[FloatingObstacle] Obstacle {gameObject.name} despawned to pool"); Logging.Debug($"[FloatingObstacle] Obstacle {gameObject.name} despawned to pool");
} }
/// <summary> /// <summary>
@@ -427,7 +428,7 @@ namespace Minigames.DivingForPictures
// Reverse movement speed (already handled by ObstacleSpawner, but this ensures consistency) // Reverse movement speed (already handled by ObstacleSpawner, but this ensures consistency)
moveSpeed *= -1; moveSpeed *= -1;
Debug.Log($"[FloatingObstacle] {gameObject.name} started surfacing with speed: {moveSpeed}"); Logging.Debug($"[FloatingObstacle] {gameObject.name} started surfacing with speed: {moveSpeed}");
} }
} }
} }

View File

@@ -1,4 +1,5 @@
using UnityEngine; using Core;
using UnityEngine;
using Pooling; using Pooling;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
@@ -21,12 +22,12 @@ namespace Minigames.DivingForPictures
FloatingObstacle obstacleComponent = obstacle.GetComponent<FloatingObstacle>(); FloatingObstacle obstacleComponent = obstacle.GetComponent<FloatingObstacle>();
if (obstacleComponent != null) if (obstacleComponent != null)
{ {
Debug.Log($"[ObstaclePool] Returning obstacle {obstacle.name} to pool"); Logging.Debug($"[ObstaclePool] Returning obstacle {obstacle.name} to pool");
Return(obstacleComponent, prefabIndex); Return(obstacleComponent, prefabIndex);
} }
else else
{ {
Debug.LogWarning($"Attempted to return a GameObject without a FloatingObstacle component: {obstacle.name}"); Logging.Warning($"Attempted to return a GameObject without a FloatingObstacle component: {obstacle.name}");
Destroy(obstacle); Destroy(obstacle);
} }
} }
@@ -38,7 +39,7 @@ namespace Minigames.DivingForPictures
/// <returns>An obstacle instance ready to use</returns> /// <returns>An obstacle instance ready to use</returns>
public GameObject GetObstacle(int prefabIndex) public GameObject GetObstacle(int prefabIndex)
{ {
Debug.Log($"[ObstaclePool] GetObstacle called for prefab index {prefabIndex}"); Logging.Debug($"[ObstaclePool] GetObstacle called for prefab index {prefabIndex}");
FloatingObstacle obstacleComponent = Get(prefabIndex); FloatingObstacle obstacleComponent = Get(prefabIndex);
if (obstacleComponent == null) if (obstacleComponent == null)
@@ -47,7 +48,7 @@ namespace Minigames.DivingForPictures
return null; return null;
} }
Debug.Log($"[ObstaclePool] Get() returned obstacle {obstacleComponent.name}, active state: {obstacleComponent.gameObject.activeInHierarchy}"); Logging.Debug($"[ObstaclePool] Get() returned obstacle {obstacleComponent.name}, active state: {obstacleComponent.gameObject.activeInHierarchy}");
return obstacleComponent.gameObject; return obstacleComponent.gameObject;
} }
} }

View File

@@ -5,6 +5,7 @@ using UnityEngine.Events;
using Pooling; using Pooling;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using Core;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -119,7 +120,7 @@ namespace Minigames.DivingForPictures
StartMoveCoroutine(); StartMoveCoroutine();
StartDespawnCoroutine(); StartDespawnCoroutine();
Debug.Log("[ObstacleSpawner] Initialized"); Logging.Debug("[ObstacleSpawner] Initialized");
} }
/// <summary> /// <summary>
@@ -151,7 +152,7 @@ namespace Minigames.DivingForPictures
} }
} }
Debug.Log($"[ObstacleSpawner] Paused with {_activeObstacles.Count} active obstacles"); Logging.Debug($"[ObstacleSpawner] Paused with {_activeObstacles.Count} active obstacles");
} }
/// <summary> /// <summary>
@@ -182,7 +183,7 @@ namespace Minigames.DivingForPictures
} }
} }
Debug.Log($"[ObstacleSpawner] Resumed with {_activeObstacles.Count} active obstacles"); Logging.Debug($"[ObstacleSpawner] Resumed with {_activeObstacles.Count} active obstacles");
} }
/// <summary> /// <summary>
@@ -232,14 +233,14 @@ namespace Minigames.DivingForPictures
// Check if the prefab has a FloatingObstacle component // Check if the prefab has a FloatingObstacle component
if (obstaclePrefabs[i].GetComponent<FloatingObstacle>() == null) if (obstaclePrefabs[i].GetComponent<FloatingObstacle>() == null)
{ {
Debug.LogWarning($"Obstacle prefab {obstaclePrefabs[i].name} does not have a FloatingObstacle component. Adding one automatically."); Logging.Warning($"Obstacle prefab {obstaclePrefabs[i].name} does not have a FloatingObstacle component. Adding one automatically.");
obstaclePrefabs[i].AddComponent<FloatingObstacle>(); obstaclePrefabs[i].AddComponent<FloatingObstacle>();
} }
// Ensure the prefab is on the correct layer (using configurable obstacleLayer) // Ensure the prefab is on the correct layer (using configurable obstacleLayer)
if (obstaclePrefabs[i].layer != _devSettings.ObstacleLayer) if (obstaclePrefabs[i].layer != _devSettings.ObstacleLayer)
{ {
Debug.LogWarning($"Obstacle prefab {obstaclePrefabs[i].name} is not on the configured obstacle layer ({_devSettings.ObstacleLayer}). Setting layer automatically."); Logging.Warning($"Obstacle prefab {obstaclePrefabs[i].name} is not on the configured obstacle layer ({_devSettings.ObstacleLayer}). Setting layer automatically.");
SetLayerRecursively(obstaclePrefabs[i], _devSettings.ObstacleLayer); SetLayerRecursively(obstaclePrefabs[i], _devSettings.ObstacleLayer);
} }
} }
@@ -319,7 +320,7 @@ namespace Minigames.DivingForPictures
// Calculate spawn range based on 80% of screen width (40% on each side from center) // Calculate spawn range based on 80% of screen width (40% on each side from center)
_spawnRangeX = (screenWidth * 0.8f) / 2f; _spawnRangeX = (screenWidth * 0.8f) / 2f;
Debug.Log($"[ObstacleSpawner] Screen calculated - Width: {screenWidth:F2}, Bottom: {_screenBottom:F2}, Spawn Range X: ±{_spawnRangeX:F2}"); Logging.Debug($"[ObstacleSpawner] Screen calculated - Width: {screenWidth:F2}, Bottom: {_screenBottom:F2}, Spawn Range X: ±{_spawnRangeX:F2}");
} }
/// <summary> /// <summary>
@@ -330,7 +331,7 @@ namespace Minigames.DivingForPictures
if (_spawnCoroutine == null) if (_spawnCoroutine == null)
{ {
_spawnCoroutine = StartCoroutine(SpawnObstaclesCoroutine()); _spawnCoroutine = StartCoroutine(SpawnObstaclesCoroutine());
Debug.Log("[ObstacleSpawner] Started spawning obstacles"); Logging.Debug("[ObstacleSpawner] Started spawning obstacles");
} }
} }
@@ -343,7 +344,7 @@ namespace Minigames.DivingForPictures
{ {
StopCoroutine(_spawnCoroutine); StopCoroutine(_spawnCoroutine);
_spawnCoroutine = null; _spawnCoroutine = null;
Debug.Log("[ObstacleSpawner] Stopped spawning obstacles"); Logging.Debug("[ObstacleSpawner] Stopped spawning obstacles");
} }
} }
@@ -375,15 +376,15 @@ namespace Minigames.DivingForPictures
// Don't spawn new obstacles when surfacing // Don't spawn new obstacles when surfacing
if (_isSurfacing) if (_isSurfacing)
{ {
Debug.Log("[ObstacleSpawner] Skipping obstacle spawn - currently surfacing"); Logging.Debug("[ObstacleSpawner] Skipping obstacle spawn - currently surfacing");
return; return;
} }
Debug.Log($"[ObstacleSpawner] TrySpawnObstacle called at {Time.time:F2}"); Logging.Debug($"[ObstacleSpawner] TrySpawnObstacle called at {Time.time:F2}");
if (obstaclePrefabs == null || obstaclePrefabs.Count == 0) if (obstaclePrefabs == null || obstaclePrefabs.Count == 0)
{ {
Debug.LogWarning("[ObstacleSpawner] No obstacle prefabs available for spawning!"); Logging.Warning("[ObstacleSpawner] No obstacle prefabs available for spawning!");
return; return;
} }
@@ -397,20 +398,20 @@ namespace Minigames.DivingForPictures
if (IsValidSpawnPosition(spawnPosition)) if (IsValidSpawnPosition(spawnPosition))
{ {
Debug.Log($"[ObstacleSpawner] Found valid position at {spawnPosition} after {attempts + 1} attempts"); Logging.Debug($"[ObstacleSpawner] Found valid position at {spawnPosition} after {attempts + 1} attempts");
SpawnObstacleAt(spawnPosition); SpawnObstacleAt(spawnPosition);
foundValidPosition = true; foundValidPosition = true;
break; break;
} }
else else
{ {
Debug.Log($"[ObstacleSpawner] Position {spawnPosition} invalid (attempt {attempts + 1}/{_settings.ObstacleMaxSpawnAttempts})"); Logging.Debug($"[ObstacleSpawner] Position {spawnPosition} invalid (attempt {attempts + 1}/{_settings.ObstacleMaxSpawnAttempts})");
} }
} }
if (!foundValidPosition) if (!foundValidPosition)
{ {
Debug.LogWarning($"[ObstacleSpawner] SPAWN MISSED: Could not find valid spawn position after {_settings.ObstacleMaxSpawnAttempts} attempts at {Time.time:F2}"); Logging.Warning($"[ObstacleSpawner] SPAWN MISSED: Could not find valid spawn position after {_settings.ObstacleMaxSpawnAttempts} attempts at {Time.time:F2}");
} }
} }
@@ -443,7 +444,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
private void SpawnObstacleAt(Vector3 position) private void SpawnObstacleAt(Vector3 position)
{ {
Debug.Log($"[ObstacleSpawner] SpawnObstacleAt called for position {position}"); Logging.Debug($"[ObstacleSpawner] SpawnObstacleAt called for position {position}");
// Select random prefab // Select random prefab
int prefabIndex = Random.Range(0, obstaclePrefabs.Count); int prefabIndex = Random.Range(0, obstaclePrefabs.Count);
@@ -460,7 +461,7 @@ namespace Minigames.DivingForPictures
// Spawn using pool or instantiate directly // Spawn using pool or instantiate directly
if (_devSettings.ObstacleUseObjectPooling && _obstaclePool != null) if (_devSettings.ObstacleUseObjectPooling && _obstaclePool != null)
{ {
Debug.Log($"[ObstacleSpawner] Requesting obstacle from pool (prefab index {prefabIndex})"); Logging.Debug($"[ObstacleSpawner] Requesting obstacle from pool (prefab index {prefabIndex})");
obstacle = _obstaclePool.GetObstacle(prefabIndex); obstacle = _obstaclePool.GetObstacle(prefabIndex);
if (obstacle == null) if (obstacle == null)
{ {
@@ -473,12 +474,12 @@ namespace Minigames.DivingForPictures
obstacle.transform.rotation = prefab.transform.rotation; obstacle.transform.rotation = prefab.transform.rotation;
obstacle.transform.SetParent(transform); obstacle.transform.SetParent(transform);
Debug.Log($"[ObstacleSpawner] Got obstacle {obstacle.name} from pool, active state: {obstacle.activeInHierarchy}"); Logging.Debug($"[ObstacleSpawner] Got obstacle {obstacle.name} from pool, active state: {obstacle.activeInHierarchy}");
// ENHANCED FORCE ACTIVATION - more robust approach // ENHANCED FORCE ACTIVATION - more robust approach
if (!obstacle.activeInHierarchy) if (!obstacle.activeInHierarchy)
{ {
Debug.LogWarning($"[ObstacleSpawner] Pool returned inactive object {obstacle.name}, force activating!"); Logging.Warning($"[ObstacleSpawner] Pool returned inactive object {obstacle.name}, force activating!");
// Configure obstacle BEFORE activation // Configure obstacle BEFORE activation
ConfigureObstacle(obstacle, prefabIndex); ConfigureObstacle(obstacle, prefabIndex);
@@ -500,7 +501,7 @@ namespace Minigames.DivingForPictures
} }
} }
Debug.Log($"[ObstacleSpawner] After force activation, {obstacle.name} active state: {obstacle.activeInHierarchy}"); Logging.Debug($"[ObstacleSpawner] After force activation, {obstacle.name} active state: {obstacle.activeInHierarchy}");
} }
else else
{ {
@@ -510,7 +511,7 @@ namespace Minigames.DivingForPictures
} }
else else
{ {
Debug.Log($"[ObstacleSpawner] Instantiating new obstacle (pooling disabled)"); Logging.Debug($"[ObstacleSpawner] Instantiating new obstacle (pooling disabled)");
obstacle = Instantiate(prefab, position, prefab.transform.rotation, transform); obstacle = Instantiate(prefab, position, prefab.transform.rotation, transform);
// Configure the newly instantiated obstacle // Configure the newly instantiated obstacle
@@ -521,16 +522,16 @@ namespace Minigames.DivingForPictures
_obstacleCounter++; _obstacleCounter++;
string oldName = obstacle.name; string oldName = obstacle.name;
obstacle.name = $"Obstacle{_obstacleCounter:D3}"; obstacle.name = $"Obstacle{_obstacleCounter:D3}";
Debug.Log($"[ObstacleSpawner] Renamed obstacle from '{oldName}' to '{obstacle.name}', active state: {obstacle.activeInHierarchy}"); Logging.Debug($"[ObstacleSpawner] Renamed obstacle from '{oldName}' to '{obstacle.name}', active state: {obstacle.activeInHierarchy}");
// Track active obstacles // Track active obstacles
_activeObstacles.Add(obstacle); _activeObstacles.Add(obstacle);
// Invoke events // Invoke events
onObstacleSpawned?.Invoke(obstacle); onObstacleSpawned?.Invoke(obstacle);
Debug.Log($"[ObstacleSpawner] After events, obstacle {obstacle.name} active state: {obstacle.activeInHierarchy}"); Logging.Debug($"[ObstacleSpawner] After events, obstacle {obstacle.name} active state: {obstacle.activeInHierarchy}");
Debug.Log($"[ObstacleSpawner] Successfully spawned obstacle {obstacle.name} at {position}. Active count: {_activeObstacles.Count}, Final active state: {obstacle.activeInHierarchy}"); Logging.Debug($"[ObstacleSpawner] Successfully spawned obstacle {obstacle.name} at {position}. Active count: {_activeObstacles.Count}, Final active state: {obstacle.activeInHierarchy}");
} }
/// <summary> /// <summary>
@@ -567,7 +568,7 @@ namespace Minigames.DivingForPictures
{ {
if (obstacle == null) return; if (obstacle == null) return;
Debug.Log($"[ObstacleSpawner] ReturnObstacleToPool called for {obstacle.name}, active state: {obstacle.activeInHierarchy}"); Logging.Debug($"[ObstacleSpawner] ReturnObstacleToPool called for {obstacle.name}, active state: {obstacle.activeInHierarchy}");
// Remove from active list // Remove from active list
_activeObstacles.Remove(obstacle); _activeObstacles.Remove(obstacle);
@@ -578,12 +579,12 @@ namespace Minigames.DivingForPictures
// Return to pool or destroy // Return to pool or destroy
if (_devSettings.ObstacleUseObjectPooling && _obstaclePool != null) if (_devSettings.ObstacleUseObjectPooling && _obstaclePool != null)
{ {
Debug.Log($"[ObstacleSpawner] Returning {obstacle.name} to pool"); Logging.Debug($"[ObstacleSpawner] Returning {obstacle.name} to pool");
_obstaclePool.ReturnObstacle(obstacle, prefabIndex); _obstaclePool.ReturnObstacle(obstacle, prefabIndex);
} }
else else
{ {
Debug.Log($"[ObstacleSpawner] Destroying {obstacle.name} (pooling disabled)"); Logging.Debug($"[ObstacleSpawner] Destroying {obstacle.name} (pooling disabled)");
Destroy(obstacle); Destroy(obstacle);
} }
} }
@@ -595,7 +596,7 @@ namespace Minigames.DivingForPictures
{ {
// This method can no longer directly modify the settings // This method can no longer directly modify the settings
// Consider implementing a runtime settings override system if needed // Consider implementing a runtime settings override system if needed
Debug.LogWarning("[ObstacleSpawner] SetSpawnInterval no longer modifies settings directly. Settings are now centralized."); Logging.Warning("[ObstacleSpawner] SetSpawnInterval no longer modifies settings directly. Settings are now centralized.");
} }
/// <summary> /// <summary>
@@ -605,7 +606,7 @@ namespace Minigames.DivingForPictures
{ {
// This method can no longer directly modify the settings // This method can no longer directly modify the settings
// Consider implementing a runtime settings override system if needed // Consider implementing a runtime settings override system if needed
Debug.LogWarning("[ObstacleSpawner] SetSpeedRange no longer modifies settings directly. Settings are now centralized."); Logging.Warning("[ObstacleSpawner] SetSpeedRange no longer modifies settings directly. Settings are now centralized.");
} }
/// <summary> /// <summary>
@@ -636,7 +637,7 @@ namespace Minigames.DivingForPictures
} }
} }
Debug.Log($"[ObstacleSpawner] Velocity factor updated to {_velocityFactor:F2}, propagated to {_activeObstacles.Count} active obstacles"); Logging.Debug($"[ObstacleSpawner] Velocity factor updated to {_velocityFactor:F2}, propagated to {_activeObstacles.Count} active obstacles");
} }
/// <summary> /// <summary>
@@ -662,7 +663,7 @@ namespace Minigames.DivingForPictures
} }
} }
Debug.Log($"[ObstacleSpawner] Started surfacing mode for {_activeObstacles.Count} active obstacles"); Logging.Debug($"[ObstacleSpawner] Started surfacing mode for {_activeObstacles.Count} active obstacles");
} }
/// <summary> /// <summary>
@@ -675,7 +676,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
private IEnumerator SpawnObstacleRoutine() private IEnumerator SpawnObstacleRoutine()
{ {
Debug.Log("[ObstacleSpawner] Started spawning coroutine"); Logging.Debug("[ObstacleSpawner] Started spawning coroutine");
while (enabled && gameObject.activeInHierarchy && !_isPaused && !_isSurfacing) while (enabled && gameObject.activeInHierarchy && !_isPaused && !_isSurfacing)
{ {
@@ -694,7 +695,7 @@ namespace Minigames.DivingForPictures
// Clear coroutine reference when stopped // Clear coroutine reference when stopped
_spawnCoroutine = null; _spawnCoroutine = null;
Debug.Log("[ObstacleSpawner] Spawning coroutine ended"); Logging.Debug("[ObstacleSpawner] Spawning coroutine ended");
} }
/// <summary> /// <summary>
@@ -704,7 +705,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
private IEnumerator MoveObstaclesRoutine() private IEnumerator MoveObstaclesRoutine()
{ {
Debug.Log("[ObstacleSpawner] Started obstacle monitoring coroutine"); Logging.Debug("[ObstacleSpawner] Started obstacle monitoring coroutine");
// This coroutine now just monitors obstacles, not moves them // This coroutine now just monitors obstacles, not moves them
while (enabled && gameObject.activeInHierarchy && !_isPaused) while (enabled && gameObject.activeInHierarchy && !_isPaused)
@@ -718,7 +719,7 @@ namespace Minigames.DivingForPictures
// Clear coroutine reference when stopped // Clear coroutine reference when stopped
_moveCoroutine = null; _moveCoroutine = null;
Debug.Log("[ObstacleSpawner] Obstacle monitoring coroutine ended"); Logging.Debug("[ObstacleSpawner] Obstacle monitoring coroutine ended");
} }
/// <summary> /// <summary>
@@ -727,7 +728,7 @@ namespace Minigames.DivingForPictures
private IEnumerator DespawnObstaclesRoutine() private IEnumerator DespawnObstaclesRoutine()
{ {
const float checkInterval = 0.5f; // Check every half second const float checkInterval = 0.5f; // Check every half second
Debug.Log("[ObstacleSpawner] Started despawn coroutine with interval: " + checkInterval); Logging.Debug("[ObstacleSpawner] Started despawn coroutine with interval: " + checkInterval);
while (enabled && gameObject.activeInHierarchy && !_isPaused) while (enabled && gameObject.activeInHierarchy && !_isPaused)
{ {
@@ -808,7 +809,7 @@ namespace Minigames.DivingForPictures
// Clear coroutine reference when stopped // Clear coroutine reference when stopped
_despawnCoroutine = null; _despawnCoroutine = null;
Debug.Log("[ObstacleSpawner] Despawn coroutine ended"); Logging.Debug("[ObstacleSpawner] Despawn coroutine ended");
} }
#if UNITY_EDITOR #if UNITY_EDITOR

View File

@@ -2,6 +2,7 @@
using System; using System;
using System.Collections; using System.Collections;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core;
namespace Minigames.DivingForPictures.PictureCamera namespace Minigames.DivingForPictures.PictureCamera
{ {
@@ -206,7 +207,7 @@ namespace Minigames.DivingForPictures.PictureCamera
float canvasWidth = canvasRect.rect.width; float canvasWidth = canvasRect.rect.width;
targetViewfinderSize = canvasWidth * 0.25f; targetViewfinderSize = canvasWidth * 0.25f;
Debug.LogWarning("[CameraViewfinderManager] No SpriteRenderer found on target, using default size"); Logging.Warning("[CameraViewfinderManager] No SpriteRenderer found on target, using default size");
return; return;
} }
@@ -290,7 +291,7 @@ namespace Minigames.DivingForPictures.PictureCamera
RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, targetScreenPosition, uiCamera, RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, targetScreenPosition, uiCamera,
out targetAnchoredPosition); out targetAnchoredPosition);
Debug.Log( Logging.Debug(
$"[CameraViewfinderManager] Target size (canvas): {targetViewfinderSize}, target anchored: {targetAnchoredPosition}"); $"[CameraViewfinderManager] Target size (canvas): {targetViewfinderSize}, target anchored: {targetAnchoredPosition}");
} }
@@ -331,7 +332,7 @@ namespace Minigames.DivingForPictures.PictureCamera
bool[] thresholdTriggered = new bool[settings.ViewfinderProgressThresholds.Length]; bool[] thresholdTriggered = new bool[settings.ViewfinderProgressThresholds.Length];
// Debug the actual values // Debug the actual values
Debug.Log($"[CameraViewfinderManager] Animation starting: startSize={startSize}, endSize={endSize}, " + Logging.Debug($"[CameraViewfinderManager] Animation starting: startSize={startSize}, endSize={endSize}, " +
$"current sizeDelta={viewfinderRectTransform.sizeDelta}"); $"current sizeDelta={viewfinderRectTransform.sizeDelta}");
// Verify the initial size is set correctly // Verify the initial size is set correctly
@@ -358,7 +359,7 @@ namespace Minigames.DivingForPictures.PictureCamera
// Additional check to ensure size is actually shrinking // Additional check to ensure size is actually shrinking
if (startSize > endSize && currentSize > startSize) if (startSize > endSize && currentSize > startSize)
{ {
Debug.LogWarning($"[CameraViewfinderManager] Animation curve producing wrong direction! " + Logging.Warning($"[CameraViewfinderManager] Animation curve producing wrong direction! " +
$"progress={animationProgress:F2}, curveValue={curveValue:F2}"); $"progress={animationProgress:F2}, curveValue={curveValue:F2}");
// Force correct behavior // Force correct behavior
curveValue = animationProgress; // Override with linear interpolation curveValue = animationProgress; // Override with linear interpolation
@@ -376,7 +377,7 @@ namespace Minigames.DivingForPictures.PictureCamera
// Log the animation state occasionally for debugging // Log the animation state occasionally for debugging
if (animationProgress % 0.25f <= 0.01f || animationProgress >= 0.99f) if (animationProgress % 0.25f <= 0.01f || animationProgress >= 0.99f)
{ {
Debug.Log($"[CameraViewfinderManager] Animation progress: {animationProgress:F2}, " + Logging.Debug($"[CameraViewfinderManager] Animation progress: {animationProgress:F2}, " +
$"curveValue={curveValue:F2}, currentSize={currentSize:F2}, currentPos={newPos}"); $"curveValue={curveValue:F2}, currentSize={currentSize:F2}, currentPos={newPos}");
} }
@@ -401,7 +402,7 @@ namespace Minigames.DivingForPictures.PictureCamera
OnAnimationCompleted?.Invoke(); OnAnimationCompleted?.Invoke();
// Log final state to confirm we reached the target size // Log final state to confirm we reached the target size
Debug.Log( Logging.Debug(
$"[CameraViewfinderManager] Animation completed: final size={viewfinderRectTransform.sizeDelta}"); $"[CameraViewfinderManager] Animation completed: final size={viewfinderRectTransform.sizeDelta}");
yield return new WaitForSecondsRealtime(0.5f); yield return new WaitForSecondsRealtime(0.5f);
@@ -471,7 +472,7 @@ namespace Minigames.DivingForPictures.PictureCamera
viewfinderInstance = null; viewfinderInstance = null;
viewfinderComponent = null; viewfinderComponent = null;
viewfinderRectTransform = null; viewfinderRectTransform = null;
Debug.Log("[CameraViewfinderManager] Hid viewfinder"); Logging.Debug("[CameraViewfinderManager] Hid viewfinder");
} }
} }
@@ -532,7 +533,7 @@ namespace Minigames.DivingForPictures.PictureCamera
viewfinderRectTransform.sizeDelta = new Vector2(canvasWidth, canvasWidth); viewfinderRectTransform.sizeDelta = new Vector2(canvasWidth, canvasWidth);
viewfinderRectTransform.anchoredPosition = Vector2.zero; viewfinderRectTransform.anchoredPosition = Vector2.zero;
Debug.Log($"[CameraViewfinderManager] Showed full-screen viewfinder with size {canvasWidth}"); Logging.Debug($"[CameraViewfinderManager] Showed full-screen viewfinder with size {canvasWidth}");
} }
/// <summary> /// <summary>
@@ -651,7 +652,7 @@ namespace Minigames.DivingForPictures.PictureCamera
bool[] thresholdTriggered = new bool[settings.ViewfinderProgressThresholds.Length]; bool[] thresholdTriggered = new bool[settings.ViewfinderProgressThresholds.Length];
// Debug the actual values // Debug the actual values
Debug.Log($"[CameraViewfinderManager] Animation sequence starting: startSize={startSize}, endSize={endSize}"); Logging.Debug($"[CameraViewfinderManager] Animation sequence starting: startSize={startSize}, endSize={endSize}");
// Verify the initial size is set correctly // Verify the initial size is set correctly
viewfinderRectTransform.sizeDelta = new Vector2(startSize, startSize); viewfinderRectTransform.sizeDelta = new Vector2(startSize, startSize);
@@ -687,7 +688,7 @@ namespace Minigames.DivingForPictures.PictureCamera
// Log the animation state occasionally for debugging // Log the animation state occasionally for debugging
if (animationProgress % 0.25f <= 0.01f || animationProgress >= 0.99f) if (animationProgress % 0.25f <= 0.01f || animationProgress >= 0.99f)
{ {
Debug.Log($"[CameraViewfinderManager] Animation progress: {animationProgress:F2}, " + Logging.Debug($"[CameraViewfinderManager] Animation progress: {animationProgress:F2}, " +
$"curveValue={curveValue:F2}, currentSize={currentSize:F2}, currentPos={newPos}, proximity={currentProximity:F2}"); $"curveValue={curveValue:F2}, currentSize={currentSize:F2}, currentPos={newPos}, proximity={currentProximity:F2}");
} }
@@ -752,7 +753,7 @@ namespace Minigames.DivingForPictures.PictureCamera
// Log the animation state occasionally for debugging // Log the animation state occasionally for debugging
if (animationProgress % 0.25f <= 0.01f || animationProgress >= 0.99f) if (animationProgress % 0.25f <= 0.01f || animationProgress >= 0.99f)
{ {
Debug.Log($"[CameraViewfinderManager] Reverse animation progress: {animationProgress:F2}, " + Logging.Debug($"[CameraViewfinderManager] Reverse animation progress: {animationProgress:F2}, " +
$"curveValue={curveValue:F2}, currentSize={currentSize:F2}, currentPos={newPos}, proximity={currentProximity:F2}"); $"curveValue={curveValue:F2}, currentSize={currentSize:F2}, currentPos={newPos}, proximity={currentProximity:F2}");
} }
@@ -835,7 +836,7 @@ namespace Minigames.DivingForPictures.PictureCamera
{ {
// Start the photo sequence when hold begins (same behavior as first tap in tap mode) // Start the photo sequence when hold begins (same behavior as first tap in tap mode)
OnViewfinderTapped?.Invoke(); OnViewfinderTapped?.Invoke();
Debug.Log("[CameraViewfinderManager] Hold started - initiating photo sequence"); Logging.Debug("[CameraViewfinderManager] Hold started - initiating photo sequence");
} }
} }
@@ -848,7 +849,7 @@ namespace Minigames.DivingForPictures.PictureCamera
{ {
// Complete the sequence when hold ends (same behavior as second tap in tap mode) // Complete the sequence when hold ends (same behavior as second tap in tap mode)
OnViewfinderTappedDuringAnimation?.Invoke(currentProximity); OnViewfinderTappedDuringAnimation?.Invoke(currentProximity);
Debug.Log("[CameraViewfinderManager] Hold ended - completing photo sequence with proximity: " + currentProximity); Logging.Debug("[CameraViewfinderManager] Hold ended - completing photo sequence with proximity: " + currentProximity);
// Complete the animation immediately // Complete the animation immediately
if (animationCoroutine != null) if (animationCoroutine != null)

View File

@@ -1,4 +1,5 @@
using UnityEngine; using Core;
using UnityEngine;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
using UnityEngine.UI; using UnityEngine.UI;
using Input; using Input;
@@ -99,7 +100,7 @@ namespace Minigames.DivingForPictures.PictureCamera
{ {
// Fire the tap event that PhotoSequenceController will listen to // Fire the tap event that PhotoSequenceController will listen to
OnViewfinderTapped?.Invoke(); OnViewfinderTapped?.Invoke();
Debug.Log($"[MDPI] Viewfinder OnTap: {position}"); Logging.Debug($"[MDPI] Viewfinder OnTap: {position}");
} }
} }
@@ -109,7 +110,7 @@ namespace Minigames.DivingForPictures.PictureCamera
{ {
// Fire the hold start event // Fire the hold start event
OnViewfinderHoldStarted?.Invoke(); OnViewfinderHoldStarted?.Invoke();
Debug.Log($"[MDPI] Viewfinder OnHoldStart: {position}"); Logging.Debug($"[MDPI] Viewfinder OnHoldStart: {position}");
} }
} }
@@ -124,7 +125,7 @@ namespace Minigames.DivingForPictures.PictureCamera
{ {
// Fire the hold end event // Fire the hold end event
OnViewfinderHoldEnded?.Invoke(); OnViewfinderHoldEnded?.Invoke();
Debug.Log($"[MDPI] Viewfinder OnHoldEnd: {position}"); Logging.Debug($"[MDPI] Viewfinder OnHoldEnd: {position}");
} }
} }

View File

@@ -1,4 +1,5 @@
using UnityEngine; using Core;
using UnityEngine;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -32,7 +33,7 @@ namespace Minigames.DivingForPictures
if (obstacle.gameObject.layer != _devSettings.ObstacleLayer) if (obstacle.gameObject.layer != _devSettings.ObstacleLayer)
{ {
// If not on the obstacle layer, don't process the collision // If not on the obstacle layer, don't process the collision
Debug.Log($"[ObstacleCollision] Ignored collision with object on layer {obstacle.gameObject.layer} (expected {_devSettings.ObstacleLayer})"); Logging.Debug($"[ObstacleCollision] Ignored collision with object on layer {obstacle.gameObject.layer} (expected {_devSettings.ObstacleLayer})");
return; return;
} }
@@ -43,7 +44,7 @@ namespace Minigames.DivingForPictures
obstacleComponent.MarkDamageDealt(); obstacleComponent.MarkDamageDealt();
} }
Debug.Log($"[ObstacleCollision] Player hit by obstacle {obstacle.gameObject.name}"); Logging.Debug($"[ObstacleCollision] Player hit by obstacle {obstacle.gameObject.name}");
} }
/// <summary> /// <summary>
@@ -51,7 +52,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
private void HandleImmunityStarted() private void HandleImmunityStarted()
{ {
Debug.Log($"[ObstacleCollision] Damage immunity started for {_gameSettings.DamageImmunityDuration} seconds"); Logging.Debug($"[ObstacleCollision] Damage immunity started for {_gameSettings.DamageImmunityDuration} seconds");
// Don't block input for obstacle damage - let player keep moving // Don't block input for obstacle damage - let player keep moving
// The shared immunity system will handle the collision prevention // The shared immunity system will handle the collision prevention
@@ -62,7 +63,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
private void HandleImmunityEnded() private void HandleImmunityEnded()
{ {
Debug.Log($"[ObstacleCollision] Damage immunity ended"); Logging.Debug($"[ObstacleCollision] Damage immunity ended");
// No special handling needed - shared immunity system handles collider re-enabling // No special handling needed - shared immunity system handles collider re-enabling
} }
} }

View File

@@ -1,6 +1,7 @@
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -40,7 +41,7 @@ namespace Minigames.DivingForPictures
targetSpriteRenderer = GetComponentInChildren<SpriteRenderer>(); targetSpriteRenderer = GetComponentInChildren<SpriteRenderer>();
if (targetSpriteRenderer != null) if (targetSpriteRenderer != null)
{ {
Debug.Log($"[PlayerBlinkBehavior] Found SpriteRenderer on child object: {targetSpriteRenderer.gameObject.name}"); Logging.Debug($"[PlayerBlinkBehavior] Found SpriteRenderer on child object: {targetSpriteRenderer.gameObject.name}");
} }
} }
} }

View File

@@ -3,6 +3,7 @@ using System;
using System.Collections; using System.Collections;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using AppleHills.Utilities; using AppleHills.Utilities;
using Core;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -228,7 +229,7 @@ namespace Minigames.DivingForPictures
{ {
playerController.enabled = false; playerController.enabled = false;
wasInputBlocked = true; wasInputBlocked = true;
Debug.Log($"[{GetType().Name}] Player input blocked during immunity"); Logging.Debug($"[{GetType().Name}] Player input blocked during immunity");
} }
} }
@@ -245,7 +246,7 @@ namespace Minigames.DivingForPictures
// Update the controller's target position to current position to prevent snapping // Update the controller's target position to current position to prevent snapping
UpdateControllerTarget(); UpdateControllerTarget();
Debug.Log($"[{GetType().Name}] Player input restored after immunity"); Logging.Debug($"[{GetType().Name}] Player input restored after immunity");
} }
} }

View File

@@ -2,6 +2,7 @@
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Input; using Input;
using AppleHillsCamera; using AppleHillsCamera;
using Core;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -59,11 +60,11 @@ namespace Minigames.DivingForPictures
edgeAnchor = FindObjectOfType<EdgeAnchor>(); edgeAnchor = FindObjectOfType<EdgeAnchor>();
if (edgeAnchor == null) if (edgeAnchor == null)
{ {
Debug.LogWarning("[PlayerController] No EdgeAnchor found in scene. Origin Y position won't update with camera changes."); Logging.Warning("[PlayerController] No EdgeAnchor found in scene. Origin Y position won't update with camera changes.");
} }
else else
{ {
Debug.Log($"[PlayerController] Auto-connected to EdgeAnchor on {edgeAnchor.gameObject.name}"); Logging.Debug($"[PlayerController] Auto-connected to EdgeAnchor on {edgeAnchor.gameObject.name}");
} }
} }
} }
@@ -101,7 +102,7 @@ namespace Minigames.DivingForPictures
InputManager.Instance?.SetDefaultConsumer(this); InputManager.Instance?.SetDefaultConsumer(this);
_isInitialized = true; _isInitialized = true;
Debug.Log("[PlayerController] Initialized"); Logging.Debug("[PlayerController] Initialized");
} }
private void OnDestroy() private void OnDestroy()
@@ -120,7 +121,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
public void OnTap(Vector2 worldPosition) public void OnTap(Vector2 worldPosition)
{ {
// Debug.Log($"[EndlessDescenderController] OnTap at {worldPosition}"); // Logging.Debug($"[EndlessDescenderController] OnTap at {worldPosition}");
float targetX = Mathf.Clamp(worldPosition.x, _settings.ClampXMin, _settings.ClampXMax); float targetX = Mathf.Clamp(worldPosition.x, _settings.ClampXMin, _settings.ClampXMax);
// Calculate tap direction (+1 for right, -1 for left) // Calculate tap direction (+1 for right, -1 for left)
@@ -141,7 +142,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
public void OnHoldStart(Vector2 worldPosition) public void OnHoldStart(Vector2 worldPosition)
{ {
// Debug.Log($"[EndlessDescenderController] OnHoldStart at {worldPosition}"); // Logging.Debug($"[EndlessDescenderController] OnHoldStart at {worldPosition}");
_targetFingerX = Mathf.Clamp(worldPosition.x, _settings.ClampXMin, _settings.ClampXMax); _targetFingerX = Mathf.Clamp(worldPosition.x, _settings.ClampXMin, _settings.ClampXMax);
_isTouchActive = true; _isTouchActive = true;
} }
@@ -151,7 +152,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
public void OnHoldMove(Vector2 worldPosition) public void OnHoldMove(Vector2 worldPosition)
{ {
// Debug.Log($"[EndlessDescenderController] OnHoldMove at {worldPosition}"); // Logging.Debug($"[EndlessDescenderController] OnHoldMove at {worldPosition}");
_targetFingerX = Mathf.Clamp(worldPosition.x, _settings.ClampXMin, _settings.ClampXMax); _targetFingerX = Mathf.Clamp(worldPosition.x, _settings.ClampXMin, _settings.ClampXMax);
} }
@@ -160,7 +161,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
public void OnHoldEnd(Vector2 worldPosition) public void OnHoldEnd(Vector2 worldPosition)
{ {
// Debug.Log($"[EndlessDescenderController] OnHoldEnd at {worldPosition}"); // Logging.Debug($"[EndlessDescenderController] OnHoldEnd at {worldPosition}");
_isTouchActive = false; _isTouchActive = false;
} }

View File

@@ -1,4 +1,5 @@
using GogoGaga.OptimizedRopesAndCables; using Core;
using GogoGaga.OptimizedRopesAndCables;
using UnityEngine; using UnityEngine;
public class RopeEndPhysicsFollower : MonoBehaviour public class RopeEndPhysicsFollower : MonoBehaviour
@@ -46,7 +47,7 @@ public class RopeEndPhysicsFollower : MonoBehaviour
if (targetTransform != null) if (targetTransform != null)
{ {
target = targetTransform; target = targetTransform;
if (debugLog) Debug.Log($"[RopeEndPhysicsFollower] Using assigned target transform: {target.name}"); if (debugLog) Logging.Debug($"[RopeEndPhysicsFollower] Using assigned target transform: {target.name}");
} }
else if (!string.IsNullOrEmpty(targetTag)) else if (!string.IsNullOrEmpty(targetTag))
{ {
@@ -54,7 +55,7 @@ public class RopeEndPhysicsFollower : MonoBehaviour
if (found) if (found)
{ {
target = found.transform; target = found.transform;
if (debugLog) Debug.Log($"[RopeEndPhysicsFollower] Found target by tag '{targetTag}': {target.name}"); if (debugLog) Logging.Debug($"[RopeEndPhysicsFollower] Found target by tag '{targetTag}': {target.name}");
} }
} }
@@ -71,14 +72,14 @@ public class RopeEndPhysicsFollower : MonoBehaviour
if (canFall) if (canFall)
{ {
physicsVelocity = new Vector2(0, -initialFallImpulse); physicsVelocity = new Vector2(0, -initialFallImpulse);
if (debugLog) Debug.Log($"[RopeEndPhysicsFollower] Initialized with target: {target.name}, initial Y velocity: {physicsVelocity.y}"); if (debugLog) Logging.Debug($"[RopeEndPhysicsFollower] Initialized with target: {target.name}, initial Y velocity: {physicsVelocity.y}");
} }
} }
else else
{ {
offset = Vector2.zero; offset = Vector2.zero;
lastTargetPosition = transform.position; lastTargetPosition = transform.position;
if (debugLog) Debug.Log($"[RopeEndPhysicsFollower] No target found"); if (debugLog) Logging.Debug($"[RopeEndPhysicsFollower] No target found");
} }
initialized = true; initialized = true;
@@ -124,7 +125,7 @@ public class RopeEndPhysicsFollower : MonoBehaviour
// Debug log to track vertical hanging behavior // Debug log to track vertical hanging behavior
if (debugLog && Time.frameCount % 120 == 0) if (debugLog && Time.frameCount % 120 == 0)
{ {
Debug.Log($"[RopeEndPhysicsFollower] Vertical hanging: target X={target.position.x}, my X={transform.position.x}, offset={xOffset}"); Logging.Debug($"[RopeEndPhysicsFollower] Vertical hanging: target X={target.position.x}, my X={transform.position.x}, offset={xOffset}");
} }
} }
@@ -142,7 +143,7 @@ public class RopeEndPhysicsFollower : MonoBehaviour
if (debugLog && Time.frameCount % 60 == 0) if (debugLog && Time.frameCount % 60 == 0)
{ {
Debug.Log($"[RopeEndPhysicsFollower] Exceeding max distance: {exceededDistance}, applying constraint"); Logging.Debug($"[RopeEndPhysicsFollower] Exceeding max distance: {exceededDistance}, applying constraint");
} }
} }
@@ -152,7 +153,7 @@ public class RopeEndPhysicsFollower : MonoBehaviour
// Log physics state periodically for debugging // Log physics state periodically for debugging
if (debugLog && Time.frameCount % 60 == 0) if (debugLog && Time.frameCount % 60 == 0)
{ {
Debug.Log($"[RopeEndPhysicsFollower] Y position: {transform.position.y}, Y velocity: {physicsVelocity.y}, Distance: {currentDistance}/{maxDistance}"); Logging.Debug($"[RopeEndPhysicsFollower] Y position: {transform.position.y}, Y velocity: {physicsVelocity.y}, Distance: {currentDistance}/{maxDistance}");
} }
// Apply physics velocity to position // Apply physics velocity to position
@@ -227,13 +228,13 @@ public class RopeEndPhysicsFollower : MonoBehaviour
if (attachedRope != null) if (attachedRope != null)
{ {
maxDistance = attachedRope.ropeLength; maxDistance = attachedRope.ropeLength;
if (debugLog) Debug.Log($"[RopeEndPhysicsFollower] Found attached rope with length: {maxDistance}"); if (debugLog) Logging.Debug($"[RopeEndPhysicsFollower] Found attached rope with length: {maxDistance}");
} }
else else
{ {
// Default fallback value if no rope is found // Default fallback value if no rope is found
maxDistance = 2f; maxDistance = 2f;
if (debugLog) Debug.Log("[RopeEndPhysicsFollower] No attached rope found, using default max distance"); if (debugLog) Logging.Debug("[RopeEndPhysicsFollower] No attached rope found, using default max distance");
} }
} }
@@ -264,7 +265,7 @@ public class RopeEndPhysicsFollower : MonoBehaviour
if (canFall) if (canFall)
{ {
physicsVelocity = new Vector2(physicsVelocity.x, -initialFallImpulse); physicsVelocity = new Vector2(physicsVelocity.x, -initialFallImpulse);
if (debugLog) Debug.Log($"[RopeEndPhysicsFollower] Reset Y velocity to {physicsVelocity.y} after target change to {target.name}"); if (debugLog) Logging.Debug($"[RopeEndPhysicsFollower] Reset Y velocity to {physicsVelocity.y} after target change to {target.name}");
} }
} }
} }
@@ -293,7 +294,7 @@ public class RopeEndPhysicsFollower : MonoBehaviour
pos.y = target.position.y; pos.y = target.position.y;
transform.position = pos; transform.position = pos;
if (debugLog) Debug.Log($"[RopeEndPhysicsFollower] Physics forcibly reset, new Y velocity: {physicsVelocity.y}"); if (debugLog) Logging.Debug($"[RopeEndPhysicsFollower] Physics forcibly reset, new Y velocity: {physicsVelocity.y}");
} }
} }
@@ -301,6 +302,6 @@ public class RopeEndPhysicsFollower : MonoBehaviour
public void SetMaxDistance(float distance) public void SetMaxDistance(float distance)
{ {
maxDistance = distance; maxDistance = distance;
if (debugLog) Debug.Log($"[RopeEndPhysicsFollower] Max distance manually set to: {maxDistance}"); if (debugLog) Logging.Debug($"[RopeEndPhysicsFollower] Max distance manually set to: {maxDistance}");
} }
} }

View File

@@ -1,6 +1,7 @@
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -19,7 +20,7 @@ namespace Minigames.DivingForPictures
if (obstacle.gameObject.layer != _devSettings.TrenchTileLayer) if (obstacle.gameObject.layer != _devSettings.TrenchTileLayer)
{ {
// If not on the trench tile layer, don't process the collision // If not on the trench tile layer, don't process the collision
Debug.Log($"[TileBumpCollision] Ignored collision with object on layer {obstacle.gameObject.layer} (expected {_devSettings.TrenchTileLayer})"); Logging.Debug($"[TileBumpCollision] Ignored collision with object on layer {obstacle.gameObject.layer} (expected {_devSettings.TrenchTileLayer})");
return; return;
} }
@@ -35,7 +36,7 @@ namespace Minigames.DivingForPictures
break; break;
} }
Debug.Log($"[TileBumpCollision] Collision handled with {_devSettings.BumpMode} mode"); Logging.Debug($"[TileBumpCollision] Collision handled with {_devSettings.BumpMode} mode");
} }
/// <summary> /// <summary>
@@ -64,7 +65,7 @@ namespace Minigames.DivingForPictures
StartBump(currentX, targetX, bumpDuration); StartBump(currentX, targetX, bumpDuration);
Debug.Log($"[TileBumpCollision] Starting impulse bump from X={currentX} to X={targetX} (force={_gameSettings.BumpForce})"); Logging.Debug($"[TileBumpCollision] Starting impulse bump from X={currentX} to X={targetX} (force={_gameSettings.BumpForce})");
} }
/// <summary> /// <summary>
@@ -82,7 +83,7 @@ namespace Minigames.DivingForPictures
StartBump(currentX, targetX, bumpDuration); StartBump(currentX, targetX, bumpDuration);
Debug.Log($"[TileBumpCollision] Starting smooth move to center from X={currentX} (speed={_gameSettings.SmoothMoveSpeed}, duration={bumpDuration:F2}s)"); Logging.Debug($"[TileBumpCollision] Starting smooth move to center from X={currentX} (speed={_gameSettings.SmoothMoveSpeed}, duration={bumpDuration:F2}s)");
} }
/// <summary> /// <summary>
@@ -144,7 +145,7 @@ namespace Minigames.DivingForPictures
_isBumping = false; _isBumping = false;
_bumpCoroutine = null; _bumpCoroutine = null;
Debug.Log("[TileBumpCollision] Bump movement completed"); Logging.Debug("[TileBumpCollision] Bump movement completed");
} }
} }
} }

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using Core;
using UnityEngine; using UnityEngine;
using Pooling; using Pooling;
@@ -26,7 +27,7 @@ namespace Minigames.DivingForPictures
} }
else else
{ {
Debug.LogWarning($"Attempted to return a GameObject without a Tile component: {tile.name}"); Logging.Warning($"Attempted to return a GameObject without a Tile component: {tile.name}");
Destroy(tile); Destroy(tile);
} }
} }

View File

@@ -7,6 +7,7 @@ using Pooling;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Utils; using Utils;
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using Core;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {
@@ -158,7 +159,7 @@ namespace Minigames.DivingForPictures
// Check if the prefab has a Tile component // Check if the prefab has a Tile component
if (tilePrefabs[i].GetComponent<Tile>() == null) if (tilePrefabs[i].GetComponent<Tile>() == null)
{ {
Debug.LogWarning($"Prefab {tilePrefabs[i].name} does not have a Tile component. Adding one automatically."); Logging.Warning($"Prefab {tilePrefabs[i].name} does not have a Tile component. Adding one automatically.");
// Add the Tile component if it doesn't exist // Add the Tile component if it doesn't exist
tilePrefabs[i].AddComponent<Tile>(); tilePrefabs[i].AddComponent<Tile>();
} }
@@ -220,7 +221,7 @@ namespace Minigames.DivingForPictures
_speedRampingCoroutine = null; _speedRampingCoroutine = null;
} }
Debug.Log("[TrenchTileSpawner] Paused"); Logging.Debug("[TrenchTileSpawner] Paused");
} }
/// <summary> /// <summary>
@@ -238,7 +239,7 @@ namespace Minigames.DivingForPictures
StartTileSpawningCoroutine(); StartTileSpawningCoroutine();
StartSpeedRampingCoroutine(); StartSpeedRampingCoroutine();
Debug.Log("[TrenchTileSpawner] Resumed"); Logging.Debug("[TrenchTileSpawner] Resumed");
} }
/// <summary> /// <summary>
@@ -264,7 +265,7 @@ namespace Minigames.DivingForPictures
StartTileSpawningCoroutine(); StartTileSpawningCoroutine();
StartSpeedRampingCoroutine(); StartSpeedRampingCoroutine();
Debug.Log("[TrenchTileSpawner] Initialized with normalized speed"); Logging.Debug("[TrenchTileSpawner] Initialized with normalized speed");
} }
/// <summary> /// <summary>
@@ -327,7 +328,7 @@ namespace Minigames.DivingForPictures
{ {
// Fallback in case no renderer is found // Fallback in case no renderer is found
_tileHeights[prefab] = DefaultTileHeight; _tileHeights[prefab] = DefaultTileHeight;
Debug.LogWarning($"No renderer found in prefab {prefab.name}. Using default height of {DefaultTileHeight}."); Logging.Warning($"No renderer found in prefab {prefab.name}. Using default height of {DefaultTileHeight}.");
} }
} }
} }
@@ -449,7 +450,7 @@ namespace Minigames.DivingForPictures
// Calculate normalization factor based on screen height // Calculate normalization factor based on screen height
_screenNormalizationFactor = Screen.height / referenceHeight; _screenNormalizationFactor = Screen.height / referenceHeight;
Debug.Log($"[TrenchTileSpawner] Screen normalization factor: {_screenNormalizationFactor} (Screen height: {Screen.height}, Reference: {referenceHeight})"); Logging.Debug($"[TrenchTileSpawner] Screen normalization factor: {_screenNormalizationFactor} (Screen height: {Screen.height}, Reference: {referenceHeight})");
} }
/// <summary> /// <summary>
@@ -466,7 +467,7 @@ namespace Minigames.DivingForPictures
// Recalculate velocity immediately // Recalculate velocity immediately
CalculateVelocity(); CalculateVelocity();
Debug.Log($"[TrenchTileSpawner] Velocity factor updated to {_velocityFactor:F2}, moveSpeed: {_baseMoveSpeed:F2}"); Logging.Debug($"[TrenchTileSpawner] Velocity factor updated to {_velocityFactor:F2}, moveSpeed: {_baseMoveSpeed:F2}");
} }
/// <summary> /// <summary>
@@ -482,7 +483,7 @@ namespace Minigames.DivingForPictures
// Reverse the active tiles array to maintain consistent indexing logic // Reverse the active tiles array to maintain consistent indexing logic
_activeTiles.Reverse(); _activeTiles.Reverse();
Debug.Log("[TrenchTileSpawner] Started surfacing - reversed array order"); Logging.Debug("[TrenchTileSpawner] Started surfacing - reversed array order");
} }
/// <summary> /// <summary>
@@ -509,7 +510,7 @@ namespace Minigames.DivingForPictures
/// </summary> /// </summary>
private IEnumerator MoveActiveTilesRoutine() private IEnumerator MoveActiveTilesRoutine()
{ {
Debug.Log($"[TrenchTileSpawner] Started movement coroutine with normalized speed: {_baseMoveSpeed:F3}"); Logging.Debug($"[TrenchTileSpawner] Started movement coroutine with normalized speed: {_baseMoveSpeed:F3}");
while (enabled && gameObject.activeInHierarchy && !_isPaused) while (enabled && gameObject.activeInHierarchy && !_isPaused)
{ {
@@ -550,7 +551,7 @@ namespace Minigames.DivingForPictures
private IEnumerator TileDestructionRoutine() private IEnumerator TileDestructionRoutine()
{ {
const float checkInterval = 0.5f; // Check every half second const float checkInterval = 0.5f; // Check every half second
Debug.Log($"[TrenchTileSpawner] Started tile destruction coroutine with interval: {checkInterval}s"); Logging.Debug($"[TrenchTileSpawner] Started tile destruction coroutine with interval: {checkInterval}s");
while (enabled && gameObject.activeInHierarchy && !_isPaused) while (enabled && gameObject.activeInHierarchy && !_isPaused)
{ {
@@ -618,7 +619,7 @@ namespace Minigames.DivingForPictures
private IEnumerator TileSpawningRoutine() private IEnumerator TileSpawningRoutine()
{ {
const float checkInterval = 0.2f; // Check every fifth of a second const float checkInterval = 0.2f; // Check every fifth of a second
Debug.Log($"[TrenchTileSpawner] Started tile spawning coroutine with interval: {checkInterval}s"); Logging.Debug($"[TrenchTileSpawner] Started tile spawning coroutine with interval: {checkInterval}s");
while (enabled && gameObject.activeInHierarchy && !_isPaused && !_stopSpawning) while (enabled && gameObject.activeInHierarchy && !_isPaused && !_stopSpawning)
{ {
@@ -711,7 +712,7 @@ namespace Minigames.DivingForPictures
private IEnumerator SpeedRampingRoutine() private IEnumerator SpeedRampingRoutine()
{ {
const float checkInterval = 1.0f; // Check once per second const float checkInterval = 1.0f; // Check once per second
Debug.Log($"[TrenchTileSpawner] Started speed ramping coroutine with interval: {checkInterval}s"); Logging.Debug($"[TrenchTileSpawner] Started speed ramping coroutine with interval: {checkInterval}s");
while (enabled && gameObject.activeInHierarchy && !_isPaused) while (enabled && gameObject.activeInHierarchy && !_isPaused)
{ {
@@ -887,7 +888,7 @@ namespace Minigames.DivingForPictures
_activeTiles.Add(tile); _activeTiles.Add(tile);
_tileLastUsed[prefabIndex] = _spawnCounter++; _tileLastUsed[prefabIndex] = _spawnCounter++;
_currentDepth++; _currentDepth++;
Debug.Log($"[TrenchTileSpawner] Current Depth: {_currentDepth}"); Logging.Debug($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
onTileSpawned?.Invoke(tile); onTileSpawned?.Invoke(tile);
// --- FLOATING AREA STATE MANAGEMENT --- // --- FLOATING AREA STATE MANAGEMENT ---
@@ -949,7 +950,7 @@ namespace Minigames.DivingForPictures
} }
_activeTiles.Add(tile); _activeTiles.Add(tile);
_currentDepth++; _currentDepth++;
Debug.Log($"[TrenchTileSpawner] Current Depth: {_currentDepth}"); Logging.Debug($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
onTileSpawned?.Invoke(tile); onTileSpawned?.Invoke(tile);
// Optionally update floating area state if needed // Optionally update floating area state if needed
Tile spawnedTile = tile.GetComponent<Tile>(); Tile spawnedTile = tile.GetComponent<Tile>();
@@ -1035,7 +1036,7 @@ namespace Minigames.DivingForPictures
{ {
if (tile == null) if (tile == null)
{ {
Debug.LogWarning("Attempted to get height of null tile!"); Logging.Warning("Attempted to get height of null tile!");
return DefaultTileHeight; return DefaultTileHeight;
} }
@@ -1171,7 +1172,7 @@ namespace Minigames.DivingForPictures
private IEnumerator TileDestructionCoroutine() private IEnumerator TileDestructionCoroutine()
{ {
const float checkInterval = 0.5f; // Check every half second as requested const float checkInterval = 0.5f; // Check every half second as requested
Debug.Log($"[TrenchTileSpawner] Started tile destruction coroutine with interval: {checkInterval}s"); Logging.Debug($"[TrenchTileSpawner] Started tile destruction coroutine with interval: {checkInterval}s");
while (enabled && gameObject.activeInHierarchy) while (enabled && gameObject.activeInHierarchy)
{ {
@@ -1248,7 +1249,7 @@ namespace Minigames.DivingForPictures
private IEnumerator TileSpawningCoroutine() private IEnumerator TileSpawningCoroutine()
{ {
const float checkInterval = 0.2f; // Check every half second as requested const float checkInterval = 0.2f; // Check every half second as requested
Debug.Log($"[TrenchTileSpawner] Started tile spawning coroutine with interval: {checkInterval}s"); Logging.Debug($"[TrenchTileSpawner] Started tile spawning coroutine with interval: {checkInterval}s");
while (enabled && gameObject.activeInHierarchy) while (enabled && gameObject.activeInHierarchy)
{ {

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using Core;
using UnityEngine; using UnityEngine;
namespace Pooling namespace Pooling
@@ -35,7 +36,7 @@ namespace Pooling
CreateNew(); CreateNew();
} }
Debug.Log($"[{GetType().Name}] Initialized with {initialPoolSize} objects"); Logging.Debug($"[{GetType().Name}] Initialized with {initialPoolSize} objects");
} }
/// <summary> /// <summary>
@@ -128,7 +129,7 @@ namespace Pooling
/// </summary> /// </summary>
public virtual void LogPoolStats() public virtual void LogPoolStats()
{ {
Debug.Log($"[{GetType().Name}] Pooled objects: {pooledObjects.Count}/{maxPoolSize} (Created: {totalCreated}, Returned: {totalReturned})"); Logging.Debug($"[{GetType().Name}] Pooled objects: {pooledObjects.Count}/{maxPoolSize} (Created: {totalCreated}, Returned: {totalReturned})");
} }
#if UNITY_EDITOR #if UNITY_EDITOR

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using Core;
using UnityEngine; using UnityEngine;
namespace Pooling namespace Pooling
@@ -58,7 +59,7 @@ namespace Pooling
} }
} }
Debug.Log($"[{GetType().Name}] Initialized with {prefabs.Count} prefab types"); Logging.Debug($"[{GetType().Name}] Initialized with {prefabs.Count} prefab types");
} }
/// <summary> /// <summary>
@@ -115,7 +116,7 @@ namespace Pooling
// Try to get a valid object from the pool, cleaning up any destroyed objects // Try to get a valid object from the pool, cleaning up any destroyed objects
if (pooledObjects.ContainsKey(prefabIndex) && pooledObjects[prefabIndex].Count > 0) if (pooledObjects.ContainsKey(prefabIndex) && pooledObjects[prefabIndex].Count > 0)
{ {
Debug.Log($"[{GetType().Name}] Found {pooledObjects[prefabIndex].Count} objects in pool for prefab index {prefabIndex}"); Logging.Debug($"[{GetType().Name}] Found {pooledObjects[prefabIndex].Count} objects in pool for prefab index {prefabIndex}");
// Keep trying until we find a valid object or the pool is empty // Keep trying until we find a valid object or the pool is empty
while (pooledObjects[prefabIndex].Count > 0) while (pooledObjects[prefabIndex].Count > 0)
@@ -126,20 +127,20 @@ namespace Pooling
// Check if the object is still valid (not destroyed) // Check if the object is still valid (not destroyed)
if (obj != null && obj.gameObject != null) if (obj != null && obj.gameObject != null)
{ {
Debug.Log($"[{GetType().Name}] Retrieved valid object {obj.name} from pool, current active state: {obj.gameObject.activeInHierarchy}"); Logging.Debug($"[{GetType().Name}] Retrieved valid object {obj.name} from pool, current active state: {obj.gameObject.activeInHierarchy}");
break; // Found a valid object break; // Found a valid object
} }
else else
{ {
// Object was destroyed, continue looking // Object was destroyed, continue looking
Debug.LogWarning($"[{GetType().Name}] Found destroyed object in pool, removing it"); Logging.Warning($"[{GetType().Name}] Found destroyed object in pool, removing it");
obj = null; obj = null;
} }
} }
} }
else else
{ {
Debug.Log($"[{GetType().Name}] No objects in pool for prefab index {prefabIndex}, creating new one"); Logging.Debug($"[{GetType().Name}] No objects in pool for prefab index {prefabIndex}, creating new one");
} }
// If we couldn't find a valid object in the pool, create a new one // If we couldn't find a valid object in the pool, create a new one
@@ -147,7 +148,7 @@ namespace Pooling
{ {
T prefab = prefabs[prefabIndex]; T prefab = prefabs[prefabIndex];
obj = Instantiate(prefab, transform); obj = Instantiate(prefab, transform);
Debug.Log($"[{GetType().Name}] Created new object {obj.name} from prefab, active state: {obj.gameObject.activeInHierarchy}"); Logging.Debug($"[{GetType().Name}] Created new object {obj.name} from prefab, active state: {obj.gameObject.activeInHierarchy}");
} }
// Ensure the object is valid before proceeding // Ensure the object is valid before proceeding
@@ -161,22 +162,22 @@ namespace Pooling
// This prevents off-screen checks from triggering during spawn process // This prevents off-screen checks from triggering during spawn process
Vector3 originalPosition = obj.transform.position; Vector3 originalPosition = obj.transform.position;
obj.transform.position = new Vector3(0f, -1000f, 0f); obj.transform.position = new Vector3(0f, -1000f, 0f);
Debug.Log($"[{GetType().Name}] Moved object {obj.name} from {originalPosition} to safe position before activation"); Logging.Debug($"[{GetType().Name}] Moved object {obj.name} from {originalPosition} to safe position before activation");
Debug.Log($"[{GetType().Name}] About to activate object {obj.name}, current state: {obj.gameObject.activeInHierarchy}"); Logging.Debug($"[{GetType().Name}] About to activate object {obj.name}, current state: {obj.gameObject.activeInHierarchy}");
obj.gameObject.SetActive(true); obj.gameObject.SetActive(true);
Debug.Log($"[{GetType().Name}] After SetActive(true), object {obj.name} state: {obj.gameObject.activeInHierarchy}"); Logging.Debug($"[{GetType().Name}] After SetActive(true), object {obj.name} state: {obj.gameObject.activeInHierarchy}");
// Call OnSpawn for IPoolable components // Call OnSpawn for IPoolable components
IPoolable poolable = obj.GetComponent<IPoolable>(); IPoolable poolable = obj.GetComponent<IPoolable>();
if (poolable != null) if (poolable != null)
{ {
Debug.Log($"[{GetType().Name}] Calling OnSpawn for object {obj.name}"); Logging.Debug($"[{GetType().Name}] Calling OnSpawn for object {obj.name}");
poolable.OnSpawn(); poolable.OnSpawn();
Debug.Log($"[{GetType().Name}] After OnSpawn, object {obj.name} state: {obj.gameObject.activeInHierarchy}"); Logging.Debug($"[{GetType().Name}] After OnSpawn, object {obj.name} state: {obj.gameObject.activeInHierarchy}");
} }
Debug.Log($"[{GetType().Name}] Returning object {obj.name} with final state: {obj.gameObject.activeInHierarchy}"); Logging.Debug($"[{GetType().Name}] Returning object {obj.name} with final state: {obj.gameObject.activeInHierarchy}");
return obj; return obj;
} }
@@ -297,7 +298,7 @@ namespace Pooling
/// </summary> /// </summary>
public virtual void LogPoolStats() public virtual void LogPoolStats()
{ {
Debug.Log($"[{GetType().Name}] Total pooled objects: {totalPooledCount}/{totalMaxPoolSize}"); Logging.Debug($"[{GetType().Name}] Total pooled objects: {totalPooledCount}/{totalMaxPoolSize}");
string prefabDetails = ""; string prefabDetails = "";
int index = 0; int index = 0;
@@ -318,7 +319,7 @@ namespace Pooling
} }
} }
Debug.Log($"[{GetType().Name}] Pool details:{prefabDetails}"); Logging.Debug($"[{GetType().Name}] Pool details:{prefabDetails}");
} }
#if UNITY_EDITOR #if UNITY_EDITOR

View File

@@ -3,6 +3,7 @@ using Interactions;
using UnityEngine; using UnityEngine;
using System; using System;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core;
using UnityEngine.Serialization; using UnityEngine.Serialization;
namespace PuzzleS namespace PuzzleS
@@ -102,7 +103,7 @@ namespace PuzzleS
} }
// Default fallback behavior // Default fallback behavior
Debug.Log($"[Puzzles] Prompt shown for {stepData?.stepId} on {gameObject.name}"); Logging.Debug($"[Puzzles] Prompt shown for {stepData?.stepId} on {gameObject.name}");
} }
/// <summary> /// <summary>
@@ -118,7 +119,7 @@ namespace PuzzleS
} }
// Default fallback behavior // Default fallback behavior
Debug.Log($"[Puzzles] Prompt hidden for {stepData?.stepId} on {gameObject.name}"); Logging.Debug($"[Puzzles] Prompt hidden for {stepData?.stepId} on {gameObject.name}");
} }
/// <summary> /// <summary>
@@ -137,7 +138,7 @@ namespace PuzzleS
} }
// Default fallback behavior // Default fallback behavior
Debug.Log($"[Puzzles] Player entered far range of {stepData?.stepId} on {gameObject.name}"); Logging.Debug($"[Puzzles] Player entered far range of {stepData?.stepId} on {gameObject.name}");
} }
/// <summary> /// <summary>
@@ -156,7 +157,7 @@ namespace PuzzleS
} }
// Default fallback behavior // Default fallback behavior
Debug.Log($"[Puzzles] Player entered close range of {stepData?.stepId} on {gameObject.name}"); Logging.Debug($"[Puzzles] Player entered close range of {stepData?.stepId} on {gameObject.name}");
} }
/// <summary> /// <summary>
@@ -175,7 +176,7 @@ namespace PuzzleS
} }
// Default fallback behavior // Default fallback behavior
Debug.Log($"[Puzzles] Player exited close range of {stepData?.stepId} on {gameObject.name}"); Logging.Debug($"[Puzzles] Player exited close range of {stepData?.stepId} on {gameObject.name}");
} }
/// <summary> /// <summary>
@@ -194,7 +195,7 @@ namespace PuzzleS
} }
// Default fallback behavior // Default fallback behavior
Debug.Log($"[Puzzles] Player exited far range of {stepData?.stepId} on {gameObject.name}"); Logging.Debug($"[Puzzles] Player exited far range of {stepData?.stepId} on {gameObject.name}");
} }
/// <summary> /// <summary>
@@ -203,7 +204,7 @@ namespace PuzzleS
public void UnlockStep() public void UnlockStep()
{ {
_isUnlocked = true; _isUnlocked = true;
Debug.Log($"[Puzzles] Step unlocked: {stepData?.stepId} on {gameObject.name}"); Logging.Debug($"[Puzzles] Step unlocked: {stepData?.stepId} on {gameObject.name}");
// Show indicator if enabled in settings // Show indicator if enabled in settings
if (puzzleIndicator != null) if (puzzleIndicator != null)
@@ -219,7 +220,7 @@ namespace PuzzleS
if (_indicator == null) if (_indicator == null)
{ {
Debug.LogWarning($"[Puzzles] Indicator prefab for {stepData?.stepId} does not implement IPuzzlePrompt"); Logging.Warning($"[Puzzles] Indicator prefab for {stepData?.stepId} does not implement IPuzzlePrompt");
} }
else else
{ {
@@ -262,7 +263,7 @@ namespace PuzzleS
public void LockStep() public void LockStep()
{ {
_isUnlocked = false; _isUnlocked = false;
Debug.Log($"[Puzzles] Step locked: {stepData?.stepId} on {gameObject.name}"); Logging.Debug($"[Puzzles] Step locked: {stepData?.stepId} on {gameObject.name}");
// Hide indicator // Hide indicator
if (_indicator != null) if (_indicator != null)
@@ -296,7 +297,7 @@ namespace PuzzleS
if (!_isUnlocked) return; if (!_isUnlocked) return;
if (success) if (success)
{ {
Debug.Log($"[Puzzles] Step interacted: {stepData?.stepId} on {gameObject.name}"); Logging.Debug($"[Puzzles] Step interacted: {stepData?.stepId} on {gameObject.name}");
PuzzleManager.Instance?.MarkPuzzleStepCompleted(stepData); PuzzleManager.Instance?.MarkPuzzleStepCompleted(stepData);
} }
} }

View File

@@ -4,7 +4,8 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
using AppleHills.Core.Settings; // Added for IInteractionSettings using AppleHills.Core.Settings;
using Core; // Added for IInteractionSettings
namespace PuzzleS namespace PuzzleS
{ {
@@ -86,7 +87,7 @@ namespace PuzzleS
{ {
SceneManager.sceneLoaded -= OnSceneLoaded; SceneManager.sceneLoaded -= OnSceneLoaded;
Debug.Log("[MDPI] OnSceneLoaded"); Logging.Debug("[MDPI] OnSceneLoaded");
_runtimeDependencies.Clear(); _runtimeDependencies.Clear();
BuildRuntimeDependencies(); BuildRuntimeDependencies();
UnlockInitialSteps(); UnlockInitialSteps();
@@ -173,7 +174,7 @@ namespace PuzzleS
_unlockedSteps.Clear(); _unlockedSteps.Clear();
BuildRuntimeDependencies(); BuildRuntimeDependencies();
UnlockInitialSteps(); UnlockInitialSteps();
Debug.Log($"[Puzzles] Registered step: {behaviour.stepData.stepId} on {behaviour.gameObject.name}"); Logging.Debug($"[Puzzles] Registered step: {behaviour.stepData.stepId} on {behaviour.gameObject.name}");
} }
} }
@@ -185,7 +186,7 @@ namespace PuzzleS
{ {
if (behaviour?.stepData == null) return; if (behaviour?.stepData == null) return;
_stepBehaviours.Remove(behaviour.stepData); _stepBehaviours.Remove(behaviour.stepData);
Debug.Log($"[Puzzles] Unregistered step: {behaviour.stepData.stepId} on {behaviour.gameObject.name}"); Logging.Debug($"[Puzzles] Unregistered step: {behaviour.stepData.stepId} on {behaviour.gameObject.name}");
} }
/// <summary> /// <summary>
@@ -198,10 +199,10 @@ namespace PuzzleS
{ {
foreach (var dep in _runtimeDependencies[step]) foreach (var dep in _runtimeDependencies[step])
{ {
Debug.Log($"[Puzzles] Step {step.stepId} depends on {dep.stepId}"); Logging.Debug($"[Puzzles] Step {step.stepId} depends on {dep.stepId}");
} }
} }
Debug.Log($"[Puzzles] Runtime dependencies built. Total steps: {_stepBehaviours.Count}"); Logging.Debug($"[Puzzles] Runtime dependencies built. Total steps: {_stepBehaviours.Count}");
} }
/// <summary> /// <summary>
@@ -213,7 +214,7 @@ namespace PuzzleS
var initialSteps = PuzzleGraphUtility.FindInitialSteps(_runtimeDependencies); var initialSteps = PuzzleGraphUtility.FindInitialSteps(_runtimeDependencies);
foreach (var step in initialSteps) foreach (var step in initialSteps)
{ {
Debug.Log($"[Puzzles] Initial step unlocked: {step.stepId}"); Logging.Debug($"[Puzzles] Initial step unlocked: {step.stepId}");
UnlockStep(step); UnlockStep(step);
} }
@@ -229,7 +230,7 @@ namespace PuzzleS
// Check if all dependencies have been completed // Check if all dependencies have been completed
if (AreRuntimeDependenciesMet(step)) if (AreRuntimeDependenciesMet(step))
{ {
Debug.Log($"[Puzzles] Chain step unlocked: {step.stepId}"); Logging.Debug($"[Puzzles] Chain step unlocked: {step.stepId}");
UnlockStep(step); UnlockStep(step);
madeProgress = true; madeProgress = true;
} }
@@ -245,7 +246,7 @@ namespace PuzzleS
{ {
if (_completedSteps.Contains(step)) return; if (_completedSteps.Contains(step)) return;
_completedSteps.Add(step); _completedSteps.Add(step);
Debug.Log($"[Puzzles] Step completed: {step.stepId}"); Logging.Debug($"[Puzzles] Step completed: {step.stepId}");
// Broadcast completion // Broadcast completion
OnStepCompleted?.Invoke(step); OnStepCompleted?.Invoke(step);
@@ -254,12 +255,12 @@ namespace PuzzleS
{ {
if (AreRuntimeDependenciesMet(unlock)) if (AreRuntimeDependenciesMet(unlock))
{ {
Debug.Log($"[Puzzles] Unlocking step {unlock.stepId} after completing {step.stepId}"); Logging.Debug($"[Puzzles] Unlocking step {unlock.stepId} after completing {step.stepId}");
UnlockStep(unlock); UnlockStep(unlock);
} }
else else
{ {
Debug.Log($"[Puzzles] Step {unlock.stepId} not unlocked yet, waiting for other dependencies"); Logging.Debug($"[Puzzles] Step {unlock.stepId} not unlocked yet, waiting for other dependencies");
} }
} }
CheckPuzzleCompletion(); CheckPuzzleCompletion();
@@ -292,7 +293,7 @@ namespace PuzzleS
{ {
behaviour.UnlockStep(); behaviour.UnlockStep();
} }
Debug.Log($"[Puzzles] Step unlocked: {step.stepId}"); Logging.Debug($"[Puzzles] Step unlocked: {step.stepId}");
// Broadcast unlock // Broadcast unlock
OnStepUnlocked?.Invoke(step); OnStepUnlocked?.Invoke(step);
@@ -305,7 +306,7 @@ namespace PuzzleS
{ {
if (_completedSteps.Count == _stepBehaviours.Count) if (_completedSteps.Count == _stepBehaviours.Count)
{ {
Debug.Log("[Puzzles] Puzzle complete! All steps finished."); Logging.Debug("[Puzzles] Puzzle complete! All steps finished.");
// TODO: Fire puzzle complete event or trigger outcome logic // TODO: Fire puzzle complete event or trigger outcome logic
} }
} }

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using AppleHills.Data.CardSystem; using AppleHills.Data.CardSystem;
using Core;
using Data.CardSystem; using Data.CardSystem;
using Pixelplacement; using Pixelplacement;
using UnityEngine; using UnityEngine;
@@ -251,7 +252,7 @@ namespace AppleHills.UI.CardSystem
// Animate card to center of slot using Pixelplacement.Tween // Animate card to center of slot using Pixelplacement.Tween
Tween.LocalPosition(cardUI.transform, Vector3.zero, 0.25f, 0f, Tween.EaseOutBack); Tween.LocalPosition(cardUI.transform, Vector3.zero, 0.25f, 0f, Tween.EaseOutBack);
Debug.Log($"[AlbumViewPage] Placed card '{cardUI.GetCardData().Name}' in album slot"); Logging.Debug($"[AlbumViewPage] Placed card '{cardUI.GetCardData().Name}' in album slot");
} }
/// <summary> /// <summary>

View File

@@ -1,6 +1,7 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using AppleHills.Data.CardSystem; using AppleHills.Data.CardSystem;
using Core;
using Data.CardSystem; using Data.CardSystem;
using Pixelplacement; using Pixelplacement;
using UnityEngine; using UnityEngine;
@@ -137,7 +138,7 @@ namespace AppleHills.UI.CardSystem
} }
else else
{ {
Debug.LogWarning("[BoosterOpeningPage] No cards were obtained from the booster pack."); Logging.Warning("[BoosterOpeningPage] No cards were obtained from the booster pack.");
UIPageController.Instance.PopPage(); UIPageController.Instance.PopPage();
} }
} }

View File

@@ -1,5 +1,6 @@
using System; using System;
using AppleHills.Data.CardSystem; using AppleHills.Data.CardSystem;
using Core;
using Data.CardSystem; using Data.CardSystem;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
@@ -168,7 +169,7 @@ namespace AppleHills.UI.CardSystem
} }
else else
{ {
Debug.Log("[CardAlbumUI] No booster packs available"); Logging.Debug("[CardAlbumUI] No booster packs available");
// TODO: Show "no boosters available" message // TODO: Show "no boosters available" message
} }
} }

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using AppleHills.Data.CardSystem; using AppleHills.Data.CardSystem;
using Core;
using Data.CardSystem; using Data.CardSystem;
using Pixelplacement; using Pixelplacement;
using UnityEngine; using UnityEngine;
@@ -136,7 +137,7 @@ namespace AppleHills.UI.CardSystem
/// </summary> /// </summary>
private void OnChangeClothesClicked() private void OnChangeClothesClicked()
{ {
Debug.Log("[CardMenuPage] Change Clothes feature coming soon!"); Logging.Debug("[CardMenuPage] Change Clothes feature coming soon!");
// No implementation yet - "Coming soon" feature // No implementation yet - "Coming soon" feature
} }

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using AppleHills.Data.CardSystem; using AppleHills.Data.CardSystem;
using Core;
using UnityEngine; using UnityEngine;
using TMPro; using TMPro;
using UnityEngine.UI; using UnityEngine.UI;
@@ -37,7 +38,7 @@ namespace AppleHills.UI.CardSystem
/// </summary> /// </summary>
public void SetupCard(CardData cardData) public void SetupCard(CardData cardData)
{ {
Debug.Log($"[CardUIElement] Setting up card with data: {cardData}"); Logging.Debug($"[CardUIElement] Setting up card with data: {cardData}");
this.cardData = cardData; this.cardData = cardData;
@@ -199,7 +200,7 @@ namespace AppleHills.UI.CardSystem
public void OnShowAnimation() public void OnShowAnimation()
{ {
// Stub for card reveal animation // Stub for card reveal animation
Debug.Log($"[CardUIElement] Showing card: {cardData?.Name}"); Logging.Debug($"[CardUIElement] Showing card: {cardData?.Name}");
// Could add animation code or call Animation Trigger here // Could add animation code or call Animation Trigger here
} }
@@ -209,7 +210,7 @@ namespace AppleHills.UI.CardSystem
public void OnMoveToBackpackAnimation() public void OnMoveToBackpackAnimation()
{ {
// Stub for animation when card moves to backpack // Stub for animation when card moves to backpack
Debug.Log($"[CardUIElement] Moving card to backpack: {cardData?.Name}"); Logging.Debug($"[CardUIElement] Moving card to backpack: {cardData?.Name}");
// Could add animation code or call Animation Trigger here // Could add animation code or call Animation Trigger here
} }
@@ -221,14 +222,14 @@ namespace AppleHills.UI.CardSystem
{ {
if (cardDefinition == null) if (cardDefinition == null)
{ {
Debug.LogWarning("[CardUIElement] Cannot create card data: No card definition assigned"); Logging.Warning("[CardUIElement] Cannot create card data: No card definition assigned");
return; return;
} }
cardData = cardDefinition.CreateCardData(); cardData = cardDefinition.CreateCardData();
UpdateCardVisuals(); UpdateCardVisuals();
Debug.Log($"[CardUIElement] Created card from definition: {cardData.Name}"); Logging.Debug($"[CardUIElement] Created card from definition: {cardData.Name}");
} }
#endif #endif
} }

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Core;
using UnityEngine; using UnityEngine;
namespace AppleHills.UI.CardSystem namespace AppleHills.UI.CardSystem
@@ -49,7 +50,7 @@ namespace AppleHills.UI.CardSystem
page.TransitionIn(); page.TransitionIn();
OnPageChanged?.Invoke(page); OnPageChanged?.Invoke(page);
Debug.Log($"[UIPageController] Pushed page: {page.PageName}"); Logging.Debug($"[UIPageController] Pushed page: {page.PageName}");
} }
/// <summary> /// <summary>
@@ -69,12 +70,12 @@ namespace AppleHills.UI.CardSystem
UIPage previousPage = _pageStack.Peek(); UIPage previousPage = _pageStack.Peek();
previousPage.TransitionIn(); previousPage.TransitionIn();
OnPageChanged?.Invoke(previousPage); OnPageChanged?.Invoke(previousPage);
Debug.Log($"[UIPageController] Popped to previous page: {previousPage.PageName}"); Logging.Debug($"[UIPageController] Popped to previous page: {previousPage.PageName}");
} }
else else
{ {
OnPageChanged?.Invoke(null); OnPageChanged?.Invoke(null);
Debug.Log("[UIPageController] Popped last page, no pages left in stack"); Logging.Debug("[UIPageController] Popped last page, no pages left in stack");
} }
} }
@@ -92,7 +93,7 @@ namespace AppleHills.UI.CardSystem
// Clear stack // Clear stack
_pageStack.Clear(); _pageStack.Clear();
OnPageChanged?.Invoke(null); OnPageChanged?.Invoke(null);
Debug.Log("[UIPageController] Cleared page stack"); Logging.Debug("[UIPageController] Cleared page stack");
} }
/// <summary> /// <summary>

View File

@@ -146,7 +146,7 @@ namespace UI
float displayProgress = Mathf.Min(steadyProgress, actualProgress); float displayProgress = Mathf.Min(steadyProgress, actualProgress);
// Log the progress values for debugging // Log the progress values for debugging
Debug.Log($"[LoadingScreen] Progress - Default: {steadyProgress:F2}, Actual: {actualProgress:F2}, Display: {displayProgress:F2}"); Logging.Debug($"[LoadingScreen] Progress - Default: {steadyProgress:F2}, Actual: {actualProgress:F2}, Display: {displayProgress:F2}");
// Directly set the progress bar fill amount without smoothing // Directly set the progress bar fill amount without smoothing
if (progressBarImage != null) if (progressBarImage != null)
@@ -159,7 +159,7 @@ namespace UI
if (steadyProgress >= 1.0f && displayProgress >= 1.0f) if (steadyProgress >= 1.0f && displayProgress >= 1.0f)
{ {
_animationComplete = true; _animationComplete = true;
Debug.Log("[LoadingScreen] Animation complete"); Logging.Debug("[LoadingScreen] Animation complete");
break; break;
} }
@@ -171,7 +171,7 @@ namespace UI
if (progressBarImage != null) if (progressBarImage != null)
{ {
progressBarImage.fillAmount = 1.0f; progressBarImage.fillAmount = 1.0f;
Debug.Log("[LoadingScreen] Final progress set to 1.0"); Logging.Debug("[LoadingScreen] Final progress set to 1.0");
} }
// Hide the screen if loading is also complete // Hide the screen if loading is also complete
@@ -180,7 +180,7 @@ namespace UI
if (loadingScreenContainer != null) if (loadingScreenContainer != null)
{ {
loadingScreenContainer.SetActive(false); loadingScreenContainer.SetActive(false);
Debug.Log("[LoadingScreen] Animation AND loading complete, hiding screen"); Logging.Debug("[LoadingScreen] Animation AND loading complete, hiding screen");
// Invoke the callback when fully hidden // Invoke the callback when fully hidden
_onLoadingScreenFullyHidden?.Invoke(); _onLoadingScreenFullyHidden?.Invoke();
@@ -196,7 +196,7 @@ namespace UI
/// </summary> /// </summary>
public void HideLoadingScreen() public void HideLoadingScreen()
{ {
Debug.Log("[LoadingScreen] Loading complete, marking loading as finished"); Logging.Debug("[LoadingScreen] Loading complete, marking loading as finished");
// Mark that loading is complete // Mark that loading is complete
_loadingComplete = true; _loadingComplete = true;
@@ -207,7 +207,7 @@ namespace UI
if (loadingScreenContainer != null) if (loadingScreenContainer != null)
{ {
loadingScreenContainer.SetActive(false); loadingScreenContainer.SetActive(false);
Debug.Log("[LoadingScreen] Animation already complete, hiding screen immediately"); Logging.Debug("[LoadingScreen] Animation already complete, hiding screen immediately");
// Invoke the callback when fully hidden // Invoke the callback when fully hidden
_onLoadingScreenFullyHidden?.Invoke(); _onLoadingScreenFullyHidden?.Invoke();
@@ -216,7 +216,7 @@ namespace UI
} }
else else
{ {
Debug.Log("[LoadingScreen] Animation still in progress, waiting for it to complete"); Logging.Debug("[LoadingScreen] Animation still in progress, waiting for it to complete");
// The coroutine will handle hiding when animation completes // The coroutine will handle hiding when animation completes
} }
} }

View File

@@ -8,7 +8,7 @@ public class MainMenu : MonoBehaviour
public async void StartGame() public async void StartGame()
{ {
// Replace with the actual scene name as set in Build Settings // Replace with the actual scene name as set in Build Settings
var progress = new Progress<float>(p => Debug.Log($"Loading progress: {p * 100:F0}%")); var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
await SceneManagerService.Instance.SwitchSceneAsync("AppleHillsOverworld", progress); await SceneManagerService.Instance.SwitchSceneAsync("AppleHillsOverworld", progress);
} }

View File

@@ -86,7 +86,7 @@ namespace UI
if(!isMainMenu) if(!isMainMenu)
HidePauseMenu(false); // Ensure menu is hidden when switching to a game level HidePauseMenu(false); // Ensure menu is hidden when switching to a game level
Debug.Log($"[PauseMenu] Setting pause menu active: {!isMainMenu} for scene: {levelName}"); Logging.Debug($"[PauseMenu] Setting pause menu active: {!isMainMenu} for scene: {levelName}");
} }
/// <summary> /// <summary>
@@ -105,7 +105,7 @@ namespace UI
InputManager.Instance.SetInputMode(InputMode.UI); InputManager.Instance.SetInputMode(InputMode.UI);
OnGamePaused?.Invoke(); OnGamePaused?.Invoke();
Debug.Log("[PauseMenu] Game Paused"); Logging.Debug("[PauseMenu] Game Paused");
} }
/// <summary> /// <summary>
@@ -124,7 +124,7 @@ namespace UI
InputManager.Instance.SetInputMode(InputMode.GameAndUI); InputManager.Instance.SetInputMode(InputMode.GameAndUI);
OnGameResumed?.Invoke(); OnGameResumed?.Invoke();
Debug.Log("[PauseMenu] Game Resumed"); Logging.Debug("[PauseMenu] Game Resumed");
} }
/// <summary> /// <summary>
@@ -141,7 +141,7 @@ namespace UI
public async void ExitToMainMenu() public async void ExitToMainMenu()
{ {
// Replace with the actual scene name as set in Build Settings // Replace with the actual scene name as set in Build Settings
var progress = new Progress<float>(p => Debug.Log($"Loading progress: {p * 100:F0}%")); var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
await SceneManagerService.Instance.SwitchSceneAsync("MainMenu", progress); await SceneManagerService.Instance.SwitchSceneAsync("MainMenu", progress);
} }
@@ -157,6 +157,12 @@ namespace UI
#endif #endif
} }
public async void ReloadLevel()
{
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
await SceneManagerService.Instance.ReloadCurrentScene(progress);
}
/// <summary> /// <summary>
/// Loads a level based on the selection from a dropdown menu. /// Loads a level based on the selection from a dropdown menu.
/// Connect this to a Dropdown's onValueChanged event and pass the selected option text. /// Connect this to a Dropdown's onValueChanged event and pass the selected option text.
@@ -168,7 +174,7 @@ namespace UI
HidePauseMenu(); HidePauseMenu();
// Replace with the actual scene name as set in Build Settings // Replace with the actual scene name as set in Build Settings
var progress = new Progress<float>(p => Debug.Log($"Loading progress: {p * 100:F0}%")); var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
switch (levelSelection) switch (levelSelection)
{ {
case 0: case 0:

View File

@@ -1,5 +1,6 @@
using UnityEngine; using UnityEngine;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core;
namespace Utils namespace Utils
{ {
@@ -42,7 +43,7 @@ namespace Utils
var settings = GameManager.GetSettingsObject<IDivingMinigameSettings>(); var settings = GameManager.GetSettingsObject<IDivingMinigameSettings>();
if (settings == null) if (settings == null)
{ {
Debug.LogWarning("[AppleHillsUtils] Could not get settings, using default reference height"); Logging.Warning("[AppleHillsUtils] Could not get settings, using default reference height");
return CalculateNormalizedMovementSpeed(normalizedSpeed, 1080f); return CalculateNormalizedMovementSpeed(normalizedSpeed, 1080f);
} }

View File

@@ -5,9 +5,6 @@ EditorBuildSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 2 serializedVersion: 2
m_Scenes: m_Scenes:
- enabled: 0
path: Assets/Scenes/SampleScene.unity
guid: 8c9cfa26abfee488c85f1582747f6a02
- enabled: 1 - enabled: 1
path: Assets/Scenes/MainMenu.unity path: Assets/Scenes/MainMenu.unity
guid: b93f2f3b39a62684c8474ba79c8f698d guid: b93f2f3b39a62684c8474ba79c8f698d

View File

@@ -820,7 +820,8 @@ PlayerSettings:
webGLCloseOnQuit: 0 webGLCloseOnQuit: 0
webWasm2023: 0 webWasm2023: 0
webEnableSubmoduleStrippingCompatibility: 0 webEnableSubmoduleStrippingCompatibility: 0
scriptingDefineSymbols: {} scriptingDefineSymbols:
Android: ENABLE_LOG
additionalCompilerArguments: {} additionalCompilerArguments: {}
platformArchitecture: {} platformArchitecture: {}
scriptingBackend: scriptingBackend: