Strip debug logging from the game, fix screen weirdness
This commit is contained in:
@@ -15,7 +15,7 @@ MonoBehaviour:
|
||||
m_DefaultGroup: 6f3207429a65b3e4b83935ac19791077
|
||||
m_currentHash:
|
||||
serializedVersion: 2
|
||||
Hash: 8453796ea514a8db40e72d511ee4981c
|
||||
Hash: 00000000000000000000000000000000
|
||||
m_OptimizeCatalogSize: 0
|
||||
m_BuildRemoteCatalog: 0
|
||||
m_CatalogRequestsTimeout: 0
|
||||
|
||||
@@ -92,7 +92,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1302888740346723223
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -688,8 +688,8 @@ RectTransform:
|
||||
- {fileID: 3400029894692319192}
|
||||
m_Father: {fileID: 5605205583985027889}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
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}
|
||||
@@ -823,9 +823,9 @@ RectTransform:
|
||||
- {fileID: 7803147924421545447}
|
||||
m_Father: {fileID: 5605205583985027889}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: -60}
|
||||
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 &2290562928139384544
|
||||
@@ -1642,9 +1642,9 @@ RectTransform:
|
||||
- {fileID: 6162719476639538323}
|
||||
m_Father: {fileID: 5605205583985027889}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 120}
|
||||
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 &3956398402257402681
|
||||
@@ -1741,6 +1741,139 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 1
|
||||
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
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1775,9 +1908,9 @@ RectTransform:
|
||||
- {fileID: 3949582524682304579}
|
||||
m_Father: {fileID: 5605205583985027889}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 60}
|
||||
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 &4255447181943714037
|
||||
@@ -2323,6 +2456,142 @@ MonoBehaviour:
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 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
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2468,6 +2737,8 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5605205583985027889}
|
||||
- component: {fileID: 8594443110142453154}
|
||||
- component: {fileID: 3446002550086852002}
|
||||
m_Layer: 0
|
||||
m_Name: Buttons
|
||||
m_TagString: Untagged
|
||||
@@ -2490,11 +2761,52 @@ RectTransform:
|
||||
- {fileID: 9052230212113207254}
|
||||
- {fileID: 44375243138864492}
|
||||
- {fileID: 6855320393561945426}
|
||||
- {fileID: 7984867635544047636}
|
||||
- {fileID: 7083543314533737593}
|
||||
m_Father: {fileID: 1302888740346723223}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 120}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_AnchoredPosition: {x: -6.442688, y: 141.47559}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
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
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using Unity.Cinemachine;
|
||||
using System;
|
||||
using Core;
|
||||
|
||||
namespace AppleHillsCamera
|
||||
{
|
||||
@@ -76,7 +77,7 @@ namespace AppleHillsCamera
|
||||
{
|
||||
if (referenceMarker == null)
|
||||
{
|
||||
Debug.LogWarning("CameraScreenAdapter: Missing reference marker.");
|
||||
Logging.Warning("CameraScreenAdapter: Missing reference marker.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,7 +96,7 @@ namespace AppleHillsCamera
|
||||
var lens = _virtualCamera.Lens;
|
||||
lens.OrthographicSize = orthoSize;
|
||||
_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
|
||||
{
|
||||
@@ -103,11 +104,11 @@ namespace AppleHillsCamera
|
||||
if (_regularCamera.orthographic)
|
||||
{
|
||||
_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
|
||||
{
|
||||
Debug.LogWarning("CameraScreenAdapter: Regular camera is not in orthographic mode.");
|
||||
Logging.Warning("CameraScreenAdapter: Regular camera is not in orthographic mode.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using AppleHills.Core;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using Core;
|
||||
|
||||
namespace AppleHillsCamera
|
||||
{
|
||||
@@ -168,7 +169,7 @@ namespace AppleHillsCamera
|
||||
{
|
||||
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
|
||||
@@ -210,14 +211,14 @@ namespace AppleHillsCamera
|
||||
if (_camera != null && adapter.GetControlledCamera() == _camera)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// If no matching camera found, use the first one
|
||||
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)
|
||||
{
|
||||
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;
|
||||
shouldUpdate = true;
|
||||
@@ -296,7 +297,7 @@ namespace AppleHillsCamera
|
||||
}
|
||||
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)
|
||||
{
|
||||
Debug.LogWarning("EdgeAnchor: Missing reference marker.");
|
||||
Logging.Warning("EdgeAnchor: Missing reference marker.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -377,7 +378,7 @@ namespace AppleHillsCamera
|
||||
// Apply the new position
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
@@ -72,7 +73,7 @@ namespace Cinematics
|
||||
_cinematicSprites.enabled = true;
|
||||
playableDirector.stopped += OnPlayableDirectorStopped;
|
||||
playableDirector.Play(assetToPlay);
|
||||
Debug.Log("Playing cinematic " + assetToPlay.name);
|
||||
Logging.Debug("Playing cinematic " + assetToPlay.name);
|
||||
_isCinematicPlaying = true;
|
||||
OnCinematicStarted?.Invoke();
|
||||
return playableDirector;
|
||||
@@ -81,7 +82,7 @@ namespace Cinematics
|
||||
void OnPlayableDirectorStopped(PlayableDirector director)
|
||||
{
|
||||
_cinematicSprites.enabled = false;
|
||||
Debug.Log("Cinematic stopped!");
|
||||
Logging.Debug("Cinematic stopped!");
|
||||
_isCinematicPlaying = false;
|
||||
OnCinematicStopped?.Invoke();
|
||||
// Release the addressable handle associated with this director
|
||||
@@ -100,7 +101,7 @@ namespace Cinematics
|
||||
// Store the handle for later release
|
||||
_addressableHandles[playableDirector] = handle;
|
||||
|
||||
Debug.Log($"[CinematicsManager] Loaded addressable cinematic: {key}");
|
||||
Logging.Debug($"[CinematicsManager] Loaded addressable cinematic: {key}");
|
||||
|
||||
return PlayCinematic(result);
|
||||
}
|
||||
@@ -112,7 +113,7 @@ namespace Cinematics
|
||||
{
|
||||
if (playableDirector != null && playableDirector.state == PlayState.Playing)
|
||||
{
|
||||
Debug.Log("Skipping current cinematic");
|
||||
Logging.Debug("Skipping current cinematic");
|
||||
playableDirector.Stop();
|
||||
}
|
||||
}
|
||||
@@ -124,7 +125,7 @@ namespace Cinematics
|
||||
{
|
||||
if (_addressableHandles.TryGetValue(director, out var handle))
|
||||
{
|
||||
Debug.Log($"[CinematicsManager] Releasing addressable handle for cinematic");
|
||||
Logging.Debug($"[CinematicsManager] Releasing addressable handle for cinematic");
|
||||
Addressables.Release(handle);
|
||||
_addressableHandles.Remove(director);
|
||||
}
|
||||
@@ -157,7 +158,7 @@ namespace Cinematics
|
||||
/// <returns>The PlayableDirector playing the cinematic</returns>
|
||||
public async System.Threading.Tasks.Task<PlayableDirector> PlayCinematicWithLoadingScreen(string key)
|
||||
{
|
||||
Debug.Log($"[CinematicsManager] Preparing to load cinematic with loading screen: {key}");
|
||||
Logging.Debug($"[CinematicsManager] Preparing to load cinematic with loading screen: {key}");
|
||||
|
||||
// First, show the loading screen BEFORE creating any async operations
|
||||
UI.LoadingScreenController.Instance.ShowLoadingScreen();
|
||||
@@ -166,7 +167,7 @@ namespace Cinematics
|
||||
await System.Threading.Tasks.Task.Yield();
|
||||
|
||||
// Now create the load handle and track its progress
|
||||
Debug.Log($"[CinematicsManager] Starting cinematic asset load: {key}");
|
||||
Logging.Debug($"[CinematicsManager] Starting cinematic asset load: {key}");
|
||||
AsyncOperationHandle<PlayableAsset> handle = Addressables.LoadAssetAsync<PlayableAsset>(key);
|
||||
|
||||
// Update the loading screen with the progress provider after the handle is created
|
||||
@@ -178,7 +179,7 @@ namespace Cinematics
|
||||
// Store the handle for later release
|
||||
_addressableHandles[playableDirector] = handle;
|
||||
|
||||
Debug.Log($"[CinematicsManager] Cinematic loaded: {key}");
|
||||
Logging.Debug($"[CinematicsManager] Cinematic loaded: {key}");
|
||||
|
||||
// Hide the loading screen
|
||||
UI.LoadingScreenController.Instance.HideLoadingScreen();
|
||||
@@ -186,7 +187,7 @@ namespace Cinematics
|
||||
// Important: Wait for the loading screen to be fully hidden before playing the cinematic
|
||||
await UI.LoadingScreenController.Instance.WaitForLoadingScreenToHideAsync();
|
||||
|
||||
Debug.Log($"[CinematicsManager] Loading screen hidden, now playing cinematic: {key}");
|
||||
Logging.Debug($"[CinematicsManager] Loading screen hidden, now playing cinematic: {key}");
|
||||
|
||||
// Play the cinematic
|
||||
return PlayCinematic(result);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Core;
|
||||
using Input;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -76,7 +77,7 @@ namespace Cinematics
|
||||
private void DoSkipCinematic()
|
||||
{
|
||||
CinematicsManager.Instance.SkipCurrentCinematic();
|
||||
Debug.Log("Cinematic skipped via touch hold");
|
||||
Logging.Debug("Cinematic skipped via touch hold");
|
||||
|
||||
// Reset UI
|
||||
if (radialProgressBar != null)
|
||||
@@ -101,7 +102,7 @@ namespace Cinematics
|
||||
_skipPerformed = false;
|
||||
_holdStartTime = Time.time;
|
||||
|
||||
Debug.Log("Starting cinematic skip gesture");
|
||||
Logging.Debug("Starting cinematic skip gesture");
|
||||
}
|
||||
|
||||
public void OnHoldMove(Vector2 position)
|
||||
@@ -120,7 +121,7 @@ namespace Cinematics
|
||||
radialProgressBar.fillAmount = 0f;
|
||||
}
|
||||
|
||||
Debug.Log("Cinematic skip gesture canceled");
|
||||
Logging.Debug("Cinematic skip gesture canceled");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using AppleHills.Core.Settings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AppleHills.Core.Interfaces;
|
||||
using Core;
|
||||
using UI;
|
||||
|
||||
/// <summary>
|
||||
@@ -81,11 +82,11 @@ public class GameManager : MonoBehaviour
|
||||
pauseMenu.OnGamePaused += OnPauseMenuPaused;
|
||||
pauseMenu.OnGameResumed += OnPauseMenuResumed;
|
||||
|
||||
Debug.Log("[GameManager] Subscribed to PauseMenu events");
|
||||
Logging.Debug("[GameManager] Subscribed to PauseMenu events");
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
_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
|
||||
OnGamePaused?.Invoke();
|
||||
|
||||
Debug.Log($"[GameManager] Game paused. Paused {_pausableComponents.Count} components.");
|
||||
Logging.Debug($"[GameManager] Game paused. Paused {_pausableComponents.Count} components.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -188,7 +189,7 @@ public class GameManager : MonoBehaviour
|
||||
// Broadcast resume event
|
||||
OnGameResumed?.Invoke();
|
||||
|
||||
Debug.Log($"[GameManager] Game resumed. Resumed {_pausableComponents.Count} components.");
|
||||
Logging.Debug($"[GameManager] Game resumed. Resumed {_pausableComponents.Count} components.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -204,7 +205,7 @@ public class GameManager : MonoBehaviour
|
||||
|
||||
private void InitializeSettings()
|
||||
{
|
||||
Debug.Log("Starting settings initialization...");
|
||||
Logging.Debug("Starting settings initialization...");
|
||||
|
||||
// Load settings synchronously
|
||||
var playerSettings = SettingsProvider.Instance.LoadSettingsSynchronous<PlayerFollowerSettings>();
|
||||
@@ -215,7 +216,7 @@ public class GameManager : MonoBehaviour
|
||||
if (playerSettings != null)
|
||||
{
|
||||
ServiceLocator.Register<IPlayerFollowerSettings>(playerSettings);
|
||||
Debug.Log("PlayerFollowerSettings registered successfully");
|
||||
Logging.Debug("PlayerFollowerSettings registered successfully");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -225,7 +226,7 @@ public class GameManager : MonoBehaviour
|
||||
if (interactionSettings != null)
|
||||
{
|
||||
ServiceLocator.Register<IInteractionSettings>(interactionSettings);
|
||||
Debug.Log("InteractionSettings registered successfully");
|
||||
Logging.Debug("InteractionSettings registered successfully");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -235,7 +236,7 @@ public class GameManager : MonoBehaviour
|
||||
if (minigameSettings != null)
|
||||
{
|
||||
ServiceLocator.Register<IDivingMinigameSettings>(minigameSettings);
|
||||
Debug.Log("MinigameSettings registered successfully");
|
||||
Logging.Debug("MinigameSettings registered successfully");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -246,11 +247,11 @@ public class GameManager : MonoBehaviour
|
||||
_settingsLoaded = playerSettings != null && interactionSettings != null && minigameSettings != null;
|
||||
if (_settingsLoaded)
|
||||
{
|
||||
Debug.Log("All settings loaded and registered with ServiceLocator");
|
||||
Logging.Debug("All settings loaded and registered with ServiceLocator");
|
||||
}
|
||||
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>
|
||||
private void InitializeDeveloperSettings()
|
||||
{
|
||||
Debug.Log("Starting developer settings initialization...");
|
||||
Logging.Debug("Starting developer settings initialization...");
|
||||
|
||||
// Load developer settings
|
||||
var divingDevSettings = DeveloperSettingsProvider.Instance.GetSettings<DivingDeveloperSettings>();
|
||||
@@ -268,11 +269,11 @@ public class GameManager : MonoBehaviour
|
||||
|
||||
if (_developerSettingsLoaded)
|
||||
{
|
||||
Debug.Log("All developer settings loaded successfully");
|
||||
Logging.Debug("All developer settings loaded successfully");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("Some developer settings failed to load");
|
||||
Logging.Warning("Some developer settings failed to load");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,11 +13,5 @@
|
||||
{
|
||||
UnityEngine.Debug.LogWarning(message);
|
||||
}
|
||||
|
||||
[System.Diagnostics.Conditional("ENABLE_LOG")]
|
||||
public static void Error(object message)
|
||||
{
|
||||
UnityEngine.Debug.LogError(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ namespace Core
|
||||
var scene = SceneManager.GetSceneByName(sceneName);
|
||||
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;
|
||||
}
|
||||
SceneUnloadStarted?.Invoke(sceneName);
|
||||
@@ -264,6 +264,11 @@ namespace Core
|
||||
// Tracks the currently loaded gameplay scene (not persistent/bootstrapper)
|
||||
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
|
||||
public async Task SwitchSceneAsync(string newSceneName, IProgress<float> progress = null)
|
||||
{
|
||||
@@ -277,7 +282,7 @@ namespace Core
|
||||
DestroyImmediate(astar.gameObject);
|
||||
}
|
||||
// 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);
|
||||
if (prevScene.isLoaded)
|
||||
@@ -286,7 +291,7 @@ namespace Core
|
||||
}
|
||||
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
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace Utility
|
||||
public GameObject orientationPromptPrefab;
|
||||
|
||||
public event Action OnOrientationCorrect;
|
||||
public event Action OnOrientationIncorrect;
|
||||
|
||||
private GameObject _promptInstance;
|
||||
private ScreenOrientationRequirement _requiredOrientation;
|
||||
@@ -139,6 +140,13 @@ namespace Utility
|
||||
|
||||
private System.Collections.IEnumerator ContinuousOrientationCheckRoutine()
|
||||
{
|
||||
while (!IsOrientationCorrect())
|
||||
{
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
}
|
||||
_orientationCorrect = true;
|
||||
OnOrientationCorrect?.Invoke();
|
||||
|
||||
while (true)
|
||||
{
|
||||
// Wait for a short interval before checking again
|
||||
@@ -147,33 +155,11 @@ namespace Utility
|
||||
// Check if orientation is now incorrect
|
||||
if (!IsOrientationCorrect())
|
||||
{
|
||||
// Pause the game using DivingGameManager
|
||||
if (DivingGameManager.Instance != null)
|
||||
{
|
||||
DivingGameManager.Instance.Pause();
|
||||
}
|
||||
|
||||
// Show the orientation prompt
|
||||
OnOrientationIncorrect?.Invoke();;
|
||||
InputManager.Instance.SetInputMode(InputMode.UI);
|
||||
ShowPrompt();
|
||||
|
||||
// Wait until orientation is correct again
|
||||
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();
|
||||
}
|
||||
_continuousOrientationCheckCoroutine = StartCoroutine(ContinuousOrientationCheckRoutine());
|
||||
yield break; // Exit this coroutine
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using System;
|
||||
using Core;
|
||||
|
||||
namespace AppleHills.Core.Settings
|
||||
{
|
||||
@@ -91,13 +92,13 @@ namespace AppleHills.Core.Settings
|
||||
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
|
||||
T resourcesSettings = Resources.Load<T>($"{_addressablePath}/{type.Name}");
|
||||
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;
|
||||
return resourcesSettings;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppleHills.Core.Settings
|
||||
@@ -20,7 +21,7 @@ namespace AppleHills.Core.Settings
|
||||
public static void Register<T>(T service) where T : class
|
||||
{
|
||||
_services[typeof(T)] = service;
|
||||
Debug.Log($"Service registered: {typeof(T).Name}");
|
||||
Logging.Debug($"Service registered: {typeof(T).Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -35,7 +36,7 @@ namespace AppleHills.Core.Settings
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -45,7 +46,7 @@ namespace AppleHills.Core.Settings
|
||||
public static void Clear()
|
||||
{
|
||||
_services.Clear();
|
||||
Debug.Log("All services cleared");
|
||||
Logging.Debug("All services cleared");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Core;
|
||||
using Pathfinding;
|
||||
|
||||
public class AnneLiseBehaviour : MonoBehaviour
|
||||
@@ -162,6 +163,6 @@ public class AnneLiseBehaviour : MonoBehaviour
|
||||
}
|
||||
annaLiseIsReady = false; // Reset the flag after taking the photo
|
||||
}
|
||||
Debug.Log("Trafalgar touched Anna Lise");
|
||||
Logging.Debug("Trafalgar touched Anna Lise");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Distancemeasurer : MonoBehaviour
|
||||
{
|
||||
playerPosition = player.transform.position;
|
||||
distance = Vector2.Distance(placePosition, playerPosition);
|
||||
//Debug.Log("Distance to player: " + distance);
|
||||
//Logging.Debug("Distance to player: " + distance);
|
||||
if (distance > playerToPlaceDistance && birdEyes.correctItemIsIn == true)
|
||||
{
|
||||
birdEyes.BirdReveal();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Core;
|
||||
using Pixelplacement;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -20,7 +21,7 @@ public class GardenerBehaviour : MonoBehaviour
|
||||
|
||||
public void stateSwitch (string StateName)
|
||||
{
|
||||
Debug.Log("State Switch to: " + StateName);
|
||||
Logging.Debug("State Switch to: " + StateName);
|
||||
stateMachineRef.ChangeState(StateName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using Pixelplacement;
|
||||
|
||||
@@ -18,12 +19,12 @@ public class LawnMowerBehaviour : MonoBehaviour
|
||||
}
|
||||
public void mowerTouched()
|
||||
{
|
||||
Debug.Log("Mower Touched");
|
||||
Logging.Debug("Mower Touched");
|
||||
}
|
||||
|
||||
public void stateSwitch(string StateName)
|
||||
{
|
||||
Debug.Log("State Switch to: " + StateName);
|
||||
Logging.Debug("State Switch to: " + StateName);
|
||||
stateMachineRef.ChangeState(StateName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using Pixelplacement;
|
||||
using System.Collections;
|
||||
using Core;
|
||||
|
||||
public class PicnicBehaviour : MonoBehaviour
|
||||
{
|
||||
@@ -56,7 +57,7 @@ public class PicnicBehaviour : MonoBehaviour
|
||||
{
|
||||
animator.SetTrigger("theyAngry");
|
||||
//stateMachine.ChangeState("Picnic PPL Angry");
|
||||
Debug.Log("Hey! Don't steal my chocolate!");
|
||||
Logging.Debug("Hey! Don't steal my chocolate!");
|
||||
}
|
||||
|
||||
public void destroyFakeChocolate()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Core;
|
||||
using Pixelplacement;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -27,7 +28,7 @@ public class SoundGenerator : MonoBehaviour
|
||||
if (!playerInside && other.CompareTag("Player"))
|
||||
{
|
||||
playerInside = true;
|
||||
Debug.Log("Player entered SoundGenerator trigger!");
|
||||
Logging.Debug("Player entered SoundGenerator trigger!");
|
||||
if (spriteRenderer != null && enterSprite != null)
|
||||
{
|
||||
spriteRenderer.sprite = enterSprite;
|
||||
@@ -49,7 +50,7 @@ public class SoundGenerator : MonoBehaviour
|
||||
if (playerInside && other.CompareTag("Player"))
|
||||
{
|
||||
playerInside = false;
|
||||
Debug.Log("Player exited SoundGenerator trigger!");
|
||||
Logging.Debug("Player exited SoundGenerator trigger!");
|
||||
if (spriteRenderer != null && exitSprite != null)
|
||||
{
|
||||
spriteRenderer.sprite = exitSprite;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class soundBird_LandingBehaviour1 : MonoBehaviour
|
||||
{
|
||||
objectTween.Cancel(); // Stop the spline tween for this object
|
||||
}
|
||||
//Debug.Log("Tween finished!");
|
||||
//Logging.Debug("Tween finished!");
|
||||
if (stateMachine != null)
|
||||
{
|
||||
animator.SetBool("isScared", false);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class soundBird_TakeOffBehaviour : MonoBehaviour
|
||||
objectTween.Cancel(); // Stop the spline tween for this object
|
||||
|
||||
}
|
||||
//Debug.Log("Tween finished!");
|
||||
//Logging.Debug("Tween finished!");
|
||||
if (stateMachine != null)
|
||||
{
|
||||
stateMachine.ChangeState("SoundBirdFlyAround"); // Change to the desired state name
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Data.CardSystem
|
||||
@@ -100,7 +101,7 @@ namespace Data.CardSystem
|
||||
{
|
||||
playerInventory.BoosterPackCount += count;
|
||||
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>
|
||||
@@ -110,7 +111,7 @@ namespace Data.CardSystem
|
||||
{
|
||||
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>();
|
||||
}
|
||||
|
||||
@@ -129,7 +130,7 @@ namespace Data.CardSystem
|
||||
// Notify listeners
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -150,7 +151,7 @@ namespace Data.CardSystem
|
||||
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
|
||||
{
|
||||
@@ -158,7 +159,7 @@ namespace Data.CardSystem
|
||||
playerInventory.AddCard(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
|
||||
{
|
||||
// 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);
|
||||
CardDefinition randomDef = availableCards[randomIndex];
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppleHills.Data.CardSystem
|
||||
@@ -86,7 +87,7 @@ namespace AppleHills.Data.CardSystem
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -107,7 +108,7 @@ namespace AppleHills.Data.CardSystem
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -128,7 +129,7 @@ namespace AppleHills.Data.CardSystem
|
||||
return sprite;
|
||||
}
|
||||
|
||||
Debug.LogWarning($"[CardVisualConfig] No shape mapping found for zone {zone}");
|
||||
Logging.Warning($"[CardVisualConfig] No shape mapping found for zone {zone}");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Dialogue
|
||||
speechBubble.DisplayDialogueContent(content, HasAnyLines());
|
||||
|
||||
// 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
|
||||
{
|
||||
@@ -98,7 +98,7 @@ namespace Dialogue
|
||||
speechBubble.DisplayDialogueLine(line, HasAnyLines());
|
||||
|
||||
// Log for debugging
|
||||
Debug.Log($"Displaying legacy text: {line}");
|
||||
Logging.Debug($"Displaying legacy text: {line}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ namespace Dialogue
|
||||
|
||||
private void MoveToNextNode()
|
||||
{
|
||||
Debug.Log("MoveToNextNode");
|
||||
Logging.Debug("MoveToNextNode");
|
||||
|
||||
// If there's no next node, complete the dialogue
|
||||
if (string.IsNullOrEmpty(currentNode.nextNodeID))
|
||||
@@ -471,7 +471,7 @@ namespace Dialogue
|
||||
|
||||
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
|
||||
if (!IsActive || IsCompleted || currentNode == null ||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using AppleHills.Core;
|
||||
using Core;
|
||||
|
||||
namespace AppleHills.Examples
|
||||
{
|
||||
@@ -17,64 +18,64 @@ namespace AppleHills.Examples
|
||||
// Print info about the player
|
||||
if (player != null)
|
||||
{
|
||||
Debug.Log($"[QuickAccessExample] Player found: {player.name}");
|
||||
Debug.Log($"[QuickAccessExample] Player position: {player.transform.position}");
|
||||
Logging.Debug($"[QuickAccessExample] Player found: {player.name}");
|
||||
Logging.Debug($"[QuickAccessExample] Player position: {player.transform.position}");
|
||||
|
||||
// Access player controller
|
||||
var playerController = QuickAccess.Instance.PlayerController;
|
||||
if (playerController != null)
|
||||
{
|
||||
Debug.Log($"[QuickAccessExample] Player controller found on object");
|
||||
Logging.Debug($"[QuickAccessExample] Player controller found on object");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[QuickAccessExample] Player controller not found");
|
||||
Logging.Warning($"[QuickAccessExample] Player controller not found");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[QuickAccessExample] Player not found in scene");
|
||||
Logging.Warning($"[QuickAccessExample] Player not found in scene");
|
||||
}
|
||||
|
||||
// Print info about the follower (Pulver)
|
||||
if (follower != null)
|
||||
{
|
||||
Debug.Log($"[QuickAccessExample] Follower found: {follower.name}");
|
||||
Debug.Log($"[QuickAccessExample] Follower position: {follower.transform.position}");
|
||||
Logging.Debug($"[QuickAccessExample] Follower found: {follower.name}");
|
||||
Logging.Debug($"[QuickAccessExample] Follower position: {follower.transform.position}");
|
||||
|
||||
// Access follower controller
|
||||
var followerController = QuickAccess.Instance.FollowerController;
|
||||
if (followerController != null)
|
||||
{
|
||||
Debug.Log($"[QuickAccessExample] Follower controller found on object");
|
||||
Logging.Debug($"[QuickAccessExample] Follower controller found on object");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[QuickAccessExample] Follower controller not found");
|
||||
Logging.Warning($"[QuickAccessExample] Follower controller not found");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[QuickAccessExample] Follower not found in scene");
|
||||
Logging.Warning($"[QuickAccessExample] Follower not found in scene");
|
||||
}
|
||||
|
||||
// Access camera
|
||||
var camera = QuickAccess.Instance.MainCamera;
|
||||
if (camera != null)
|
||||
{
|
||||
Debug.Log($"[QuickAccessExample] Main camera found: {camera.name}");
|
||||
Debug.Log($"[QuickAccessExample] Camera position: {camera.transform.position}");
|
||||
Logging.Debug($"[QuickAccessExample] Main camera found: {camera.name}");
|
||||
Logging.Debug($"[QuickAccessExample] Camera position: {camera.transform.position}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[QuickAccessExample] Main camera not found");
|
||||
Logging.Warning($"[QuickAccessExample] Main camera not found");
|
||||
}
|
||||
|
||||
// Access managers
|
||||
try
|
||||
{
|
||||
Debug.Log($"[QuickAccessExample] Game Manager instance accessed: {QuickAccess.Instance.GameManager != null}");
|
||||
Debug.Log($"[QuickAccessExample] Input Manager instance accessed: {QuickAccess.Instance.InputManager != null}");
|
||||
Logging.Debug($"[QuickAccessExample] Game Manager instance accessed: {QuickAccess.Instance.GameManager != null}");
|
||||
Logging.Debug($"[QuickAccessExample] Input Manager instance accessed: {QuickAccess.Instance.InputManager != null}");
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,8 @@ using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
using AppleHills.Core.Settings; // Added for IInteractionSettings
|
||||
using AppleHills.Core.Settings;
|
||||
using Core; // Added for IInteractionSettings
|
||||
|
||||
namespace Input
|
||||
{
|
||||
@@ -89,12 +90,12 @@ namespace Input
|
||||
{
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("[InputManager] SwitchInputOnSceneLoaded - Setting InputMode to PlayerTouch");
|
||||
Logging.Debug("[InputManager] SwitchInputOnSceneLoaded - Setting InputMode to PlayerTouch");
|
||||
SetInputMode(InputMode.GameAndUI);
|
||||
}
|
||||
}
|
||||
@@ -165,24 +166,24 @@ namespace Input
|
||||
Vector2 screenPos = positionAction.ReadValue<Vector2>();
|
||||
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
|
||||
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
|
||||
if (TryDelegateToOverrideConsumer(screenPos, worldPos2D))
|
||||
{
|
||||
Debug.Log("[InputManager] Tap delegated to override consumer");
|
||||
Logging.Debug("[InputManager] Tap delegated to override consumer");
|
||||
return;
|
||||
}
|
||||
|
||||
// Then try to delegate to any ITouchInputConsumer (UI or world interactable)
|
||||
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);
|
||||
}
|
||||
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>();
|
||||
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
|
||||
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
|
||||
if (_overrideConsumers.Count > 0)
|
||||
{
|
||||
_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);
|
||||
return;
|
||||
}
|
||||
@@ -221,7 +222,7 @@ namespace Input
|
||||
Vector2 screenPos = positionAction.ReadValue<Vector2>();
|
||||
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
|
||||
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
|
||||
_activeHoldConsumer?.OnHoldEnd(worldPos2D);
|
||||
@@ -238,7 +239,7 @@ namespace Input
|
||||
Vector2 screenPos = positionAction.ReadValue<Vector2>();
|
||||
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
|
||||
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
|
||||
_activeHoldConsumer?.OnHoldMove(worldPos2D);
|
||||
@@ -285,7 +286,7 @@ namespace Input
|
||||
}
|
||||
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);
|
||||
return true;
|
||||
}
|
||||
@@ -314,7 +315,7 @@ namespace Input
|
||||
}
|
||||
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);
|
||||
return true;
|
||||
}
|
||||
@@ -328,15 +329,15 @@ namespace Input
|
||||
var consumer = hit.GetComponent<ITouchInputConsumer>();
|
||||
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);
|
||||
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
|
||||
{
|
||||
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;
|
||||
}
|
||||
@@ -351,7 +352,7 @@ namespace Input
|
||||
return;
|
||||
|
||||
_overrideConsumers.Add(consumer);
|
||||
Debug.Log($"[InputManager] Override consumer registered: {consumer}");
|
||||
Logging.Debug($"[InputManager] Override consumer registered: {consumer}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -369,7 +370,7 @@ namespace Input
|
||||
}
|
||||
|
||||
_overrideConsumers.Remove(consumer);
|
||||
Debug.Log($"[InputManager] Override consumer unregistered: {consumer}");
|
||||
Logging.Debug($"[InputManager] Override consumer unregistered: {consumer}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -379,7 +380,7 @@ namespace Input
|
||||
{
|
||||
_activeHoldConsumer = null;
|
||||
_overrideConsumers.Clear();
|
||||
Debug.Log("[InputManager] All override consumers cleared.");
|
||||
Logging.Debug("[InputManager] All override consumers cleared.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -392,7 +393,7 @@ namespace Input
|
||||
|
||||
// Get the topmost override consumer (last registered)
|
||||
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);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using Pathfinding;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
|
||||
namespace Input
|
||||
{
|
||||
@@ -83,7 +84,7 @@ namespace Input
|
||||
public void OnTap(Vector2 worldPosition)
|
||||
{
|
||||
InterruptMoveTo();
|
||||
Debug.Log($"[PlayerTouchController] OnTap at {worldPosition}");
|
||||
Logging.Debug($"[PlayerTouchController] OnTap at {worldPosition}");
|
||||
if (aiPath != null)
|
||||
{
|
||||
aiPath.enabled = true;
|
||||
@@ -102,7 +103,7 @@ namespace Input
|
||||
public void OnHoldStart(Vector2 worldPosition)
|
||||
{
|
||||
InterruptMoveTo();
|
||||
Debug.Log($"[PlayerTouchController] OnHoldStart at {worldPosition}");
|
||||
Logging.Debug($"[PlayerTouchController] OnHoldStart at {worldPosition}");
|
||||
lastHoldPosition = worldPosition;
|
||||
isHolding = true;
|
||||
if (_settings.DefaultHoldMovementMode == HoldMovementMode.Pathfinding &&
|
||||
@@ -139,7 +140,7 @@ namespace Input
|
||||
/// </summary>
|
||||
public void OnHoldEnd(Vector2 worldPosition)
|
||||
{
|
||||
Debug.Log($"[PlayerTouchController] OnHoldEnd at {worldPosition}");
|
||||
Logging.Debug($"[PlayerTouchController] OnHoldEnd at {worldPosition}");
|
||||
isHolding = false;
|
||||
directMoveVelocity = Vector3.zero;
|
||||
if (aiPath != null && _settings.DefaultHoldMovementMode ==
|
||||
@@ -315,13 +316,13 @@ namespace Input
|
||||
{
|
||||
_isMoving = true;
|
||||
OnMovementStarted?.Invoke();
|
||||
Debug.Log("[PlayerTouchController] Movement started");
|
||||
Logging.Debug("[PlayerTouchController] Movement started");
|
||||
}
|
||||
else if (!isCurrentlyMoving && _isMoving)
|
||||
{
|
||||
_isMoving = false;
|
||||
OnMovementStopped?.Invoke();
|
||||
Debug.Log("[PlayerTouchController] Movement stopped");
|
||||
Logging.Debug("[PlayerTouchController] Movement stopped");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Events;
|
||||
using System.Threading.Tasks;
|
||||
using Core;
|
||||
|
||||
namespace Interactions
|
||||
{
|
||||
@@ -100,10 +101,10 @@ namespace Interactions
|
||||
{
|
||||
if (!_isActive)
|
||||
{
|
||||
Debug.Log($"[Interactable] Is disabled!");
|
||||
Logging.Debug($"[Interactable] Is disabled!");
|
||||
return;
|
||||
}
|
||||
Debug.Log($"[Interactable] OnTap at {worldPosition} on {gameObject.name}");
|
||||
Logging.Debug($"[Interactable] OnTap at {worldPosition} on {gameObject.name}");
|
||||
|
||||
// Start the interaction process asynchronously
|
||||
_ = TryInteractAsync();
|
||||
@@ -129,7 +130,7 @@ namespace Interactions
|
||||
{
|
||||
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();
|
||||
await DispatchEventAsync(InteractionEventType.InteractionInterrupted);
|
||||
return;
|
||||
@@ -372,9 +373,9 @@ namespace Interactions
|
||||
|
||||
// Dispatch InteractingCharacterArrived event and WAIT for all actions to complete
|
||||
// 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);
|
||||
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
|
||||
bool hasTimelineActions = false;
|
||||
|
||||
@@ -3,6 +3,7 @@ using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Core;
|
||||
using Input;
|
||||
|
||||
namespace Interactions
|
||||
@@ -156,7 +157,7 @@ namespace Interactions
|
||||
{
|
||||
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
|
||||
}
|
||||
|
||||
@@ -175,7 +176,7 @@ namespace Interactions
|
||||
}
|
||||
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)
|
||||
@@ -195,7 +196,7 @@ namespace Interactions
|
||||
}
|
||||
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)
|
||||
@@ -212,7 +213,7 @@ namespace Interactions
|
||||
playableDirector.stopped += OnPlayableDirectorStopped;
|
||||
|
||||
// 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
|
||||
playableDirector.Play();
|
||||
@@ -224,7 +225,7 @@ namespace Interactions
|
||||
bool result = await _currentPlaybackTCS.Task;
|
||||
|
||||
// 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
|
||||
_currentPlaybackTCS = null;
|
||||
@@ -237,7 +238,7 @@ namespace Interactions
|
||||
if (director != playableDirector || _currentPlaybackTCS == null)
|
||||
return;
|
||||
|
||||
Debug.Log($"[InteractionTimelineAction] PlayableDirector stopped. Signaling completion.");
|
||||
Logging.Debug($"[InteractionTimelineAction] PlayableDirector stopped. Signaling completion.");
|
||||
|
||||
// Signal completion when the director stops
|
||||
_currentPlaybackTCS.TrySetResult(true);
|
||||
@@ -250,7 +251,7 @@ namespace Interactions
|
||||
// If the TCS still exists after timeout, complete it with failure
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Interactions
|
||||
|
||||
protected override void OnCharacterArrived()
|
||||
{
|
||||
Debug.Log("[ItemSlot] OnCharacterArrived");
|
||||
Logging.Debug("[ItemSlot] OnCharacterArrived");
|
||||
|
||||
var heldItemData = FollowerController.CurrentlyHeldItemData;
|
||||
var heldItemObj = FollowerController.GetHeldPickupObject();
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Interactions
|
||||
|
||||
protected virtual void OnCharacterArrived()
|
||||
{
|
||||
Debug.Log("[Pickup] OnCharacterArrived");
|
||||
Logging.Debug("[Pickup] OnCharacterArrived");
|
||||
|
||||
var combinationResult = FollowerController.TryCombineItems(this, out var combinationResultItem);
|
||||
if (combinationResultItem != null)
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace LevelS
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections;
|
||||
using Pooling;
|
||||
using AppleHills.Core.Interfaces;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -72,7 +73,7 @@ namespace Minigames.DivingForPictures
|
||||
StopBubbleBehavior();
|
||||
|
||||
// Debug log for troubleshooting
|
||||
Debug.Log($"[Bubble] Paused bubble: {name}");
|
||||
Logging.Debug($"[Bubble] Paused bubble: {name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -86,7 +87,7 @@ namespace Minigames.DivingForPictures
|
||||
StartBubbleBehavior();
|
||||
|
||||
// Debug log for troubleshooting
|
||||
Debug.Log($"[Bubble] Resumed bubble: {name}");
|
||||
Logging.Debug($"[Bubble] Resumed bubble: {name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -195,7 +196,7 @@ namespace Minigames.DivingForPictures
|
||||
BubblePool pool = FindFirstObjectByType<BubblePool>();
|
||||
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);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using Pooling;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
@@ -36,7 +37,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
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})");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using UnityEngine;
|
||||
using AppleHills.Core.Settings;
|
||||
using AppleHills.Core.Interfaces;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -106,7 +107,7 @@ namespace Minigames.DivingForPictures
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log("[BubbleSpawner] Paused");
|
||||
Logging.Debug("[BubbleSpawner] Paused");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -131,7 +132,7 @@ namespace Minigames.DivingForPictures
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log("[BubbleSpawner] Resumed");
|
||||
Logging.Debug("[BubbleSpawner] Resumed");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -153,7 +154,7 @@ namespace Minigames.DivingForPictures
|
||||
if (_devSettings == null) return;
|
||||
|
||||
_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>
|
||||
@@ -239,7 +240,7 @@ namespace Minigames.DivingForPictures
|
||||
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>
|
||||
@@ -258,7 +259,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
private IEnumerator SpawnBubblesRoutine()
|
||||
{
|
||||
Debug.Log("[BubbleSpawner] Started bubble spawning coroutine");
|
||||
Logging.Debug("[BubbleSpawner] Started bubble spawning coroutine");
|
||||
|
||||
while (enabled && gameObject.activeInHierarchy && !_isPaused)
|
||||
{
|
||||
@@ -269,7 +270,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
_spawnCoroutine = null;
|
||||
|
||||
Debug.Log("[BubbleSpawner] Bubble spawning coroutine ended");
|
||||
Logging.Debug("[BubbleSpawner] Bubble spawning coroutine ended");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ using UnityEngine.Playables;
|
||||
using AppleHills.Core.Settings;
|
||||
using Utility;
|
||||
using AppleHills.Core.Interfaces;
|
||||
using Core;
|
||||
using Input;
|
||||
using UI;
|
||||
using Minigames.DivingForPictures.PictureCamera;
|
||||
@@ -144,11 +145,11 @@ namespace Minigames.DivingForPictures
|
||||
pauseMenu.OnGamePaused += Pause;
|
||||
pauseMenu.OnGameResumed += DoResume;
|
||||
|
||||
Debug.Log("[DivingGameManager] Subscribed to PauseMenu events");
|
||||
Logging.Debug("[DivingGameManager] Subscribed to PauseMenu events");
|
||||
}
|
||||
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
|
||||
@@ -161,6 +162,7 @@ namespace Minigames.DivingForPictures
|
||||
if (SceneOrientationEnforcer.Instance != null)
|
||||
{
|
||||
SceneOrientationEnforcer.Instance.OnOrientationCorrect += InitializeGame;
|
||||
SceneOrientationEnforcer.Instance.OnOrientationIncorrect += Pause;
|
||||
|
||||
// If orientation is already correct, initialize right away
|
||||
// This prevents issues if the orientation was already correct before subscription
|
||||
@@ -171,7 +173,7 @@ namespace Minigames.DivingForPictures
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[DivingGameManager] SceneOrientationEnforcer not found. Initializing game immediately.");
|
||||
Logging.Warning("[DivingGameManager] SceneOrientationEnforcer not found. Initializing game immediately.");
|
||||
InitializeGame();
|
||||
}
|
||||
|
||||
@@ -210,6 +212,7 @@ namespace Minigames.DivingForPictures
|
||||
if (SceneOrientationEnforcer.Instance != null)
|
||||
{
|
||||
SceneOrientationEnforcer.Instance.OnOrientationCorrect -= InitializeGame;
|
||||
SceneOrientationEnforcer.Instance.OnOrientationIncorrect -= Pause;
|
||||
}
|
||||
|
||||
// Unsubscribe from PauseMenu events
|
||||
@@ -294,11 +297,11 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
private void SpawnMonster(Transform spawnPoint)
|
||||
{
|
||||
Debug.Log("Spawning monster: " + spawnPoint.name);
|
||||
Logging.Debug("Spawning monster: " + spawnPoint.name);
|
||||
|
||||
if (monsterPrefabs.Length == 0)
|
||||
{
|
||||
Debug.LogWarning("No monster prefabs assigned to DivingGameManager.");
|
||||
Logging.Warning("No monster prefabs assigned to DivingGameManager.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -359,7 +362,7 @@ namespace Minigames.DivingForPictures
|
||||
int remainingRopes = playerRopes.Length - currentRopeIndex;
|
||||
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
|
||||
{
|
||||
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
|
||||
@@ -406,7 +409,7 @@ namespace Minigames.DivingForPictures
|
||||
if (isGameOver) return;
|
||||
|
||||
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
|
||||
OnGameOver?.Invoke();
|
||||
@@ -422,7 +425,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -430,7 +433,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
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>
|
||||
@@ -510,7 +513,7 @@ namespace Minigames.DivingForPictures
|
||||
// Start coroutine to animate the rock falling offscreen
|
||||
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
|
||||
@@ -534,7 +537,7 @@ namespace Minigames.DivingForPictures
|
||||
// Start coroutine to reset X position to 0 over 1 second
|
||||
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)
|
||||
@@ -566,7 +569,7 @@ namespace Minigames.DivingForPictures
|
||||
}
|
||||
surfacingSequenceCoroutine = StartCoroutine(SurfacingSequence());
|
||||
|
||||
Debug.Log($"[DivingGameManager] Started surfacing with target velocity factor: {targetVelocityFactor}");
|
||||
Logging.Debug($"[DivingGameManager] Started surfacing with target velocity factor: {targetVelocityFactor}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -580,7 +583,7 @@ namespace Minigames.DivingForPictures
|
||||
UnityEngine.Camera mainCamera = UnityEngine.Camera.main;
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -648,7 +651,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
// Tell it to stop spawning new tiles
|
||||
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)
|
||||
{
|
||||
surfacingTimeline.Play();
|
||||
Debug.Log("[DivingGameManager] Last tile left the screen, playing timeline");
|
||||
Logging.Debug("[DivingGameManager] Last tile left the screen, playing timeline");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[DivingGameManager] No surfacing timeline assigned!");
|
||||
Logging.Warning("[DivingGameManager] No surfacing timeline assigned!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,7 +687,7 @@ namespace Minigames.DivingForPictures
|
||||
activeMonsters.Clear();
|
||||
|
||||
// Final score could be saved to player prefs or other persistence
|
||||
Debug.Log($"Final Score: {playerScore}");
|
||||
Logging.Debug($"Final Score: {playerScore}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -747,7 +750,7 @@ namespace Minigames.DivingForPictures
|
||||
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))
|
||||
{
|
||||
_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)
|
||||
InputManager.Instance.SetInputMode(InputMode.UI);
|
||||
|
||||
Debug.Log($"[DivingGameManager] Game paused. Paused {_pausableComponents.Count} components.");
|
||||
Logging.Debug($"[DivingGameManager] Game paused. Paused {_pausableComponents.Count} components.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -809,7 +812,7 @@ namespace Minigames.DivingForPictures
|
||||
// Change input mode to UI when menu is open
|
||||
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
|
||||
@@ -819,7 +822,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
private void OnReverseAnimationStarted()
|
||||
{
|
||||
Debug.Log("[DivingGameManager] Viewfinder animation entering reverse (zoom-out) phase");
|
||||
Logging.Debug("[DivingGameManager] Viewfinder animation entering reverse (zoom-out) phase");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -842,7 +845,7 @@ namespace Minigames.DivingForPictures
|
||||
// Store the proximity value at the time of tap for scoring
|
||||
_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
|
||||
TakePicture();
|
||||
@@ -883,7 +886,7 @@ namespace Minigames.DivingForPictures
|
||||
// Calculate total score
|
||||
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}");
|
||||
|
||||
// Add score
|
||||
@@ -932,7 +935,7 @@ namespace Minigames.DivingForPictures
|
||||
_isPhotoSequenceActive = false;
|
||||
_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>
|
||||
@@ -956,10 +959,16 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
public void InitializeGame()
|
||||
{
|
||||
if (_isGameInitialized)
|
||||
{
|
||||
DoResume();
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent double initialization
|
||||
if (_isGameInitialized) return;
|
||||
|
||||
Debug.Log("[DivingGameManager] Initializing game");
|
||||
Logging.Debug("[DivingGameManager] Initializing game");
|
||||
|
||||
// Subscribe to tile spawned event
|
||||
TrenchTileSpawner tileSpawner = FindFirstObjectByType<TrenchTileSpawner>();
|
||||
@@ -969,7 +978,7 @@ namespace Minigames.DivingForPictures
|
||||
}
|
||||
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
|
||||
@@ -1021,7 +1030,7 @@ namespace Minigames.DivingForPictures
|
||||
if (viewfinderManager != null)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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
|
||||
@@ -1052,7 +1061,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
// Pause the game immediately
|
||||
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
|
||||
_isPhotoSequenceActive = true;
|
||||
@@ -1070,7 +1079,7 @@ namespace Minigames.DivingForPictures
|
||||
if (viewfinderManager != null)
|
||||
{
|
||||
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
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -29,7 +30,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Debug.Log("Monster created: " + gameObject.name);
|
||||
Logging.Debug("Monster created: " + gameObject.name);
|
||||
|
||||
if (detectionCollider == null)
|
||||
detectionCollider = GetComponent<CircleCollider2D>();
|
||||
@@ -48,7 +49,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Debug.Log("Monster destroyed: " + gameObject.name);
|
||||
Logging.Debug("Monster destroyed: " + gameObject.name);
|
||||
}
|
||||
|
||||
private IEnumerator CheckIfOffScreen()
|
||||
|
||||
@@ -4,6 +4,7 @@ using AppleHills.Core.Settings;
|
||||
using Pooling;
|
||||
using Utils;
|
||||
using AppleHills.Core.Interfaces;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -84,7 +85,7 @@ namespace Minigames.DivingForPictures
|
||||
_settings = GameManager.GetSettingsObject<IDivingMinigameSettings>();
|
||||
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
|
||||
}
|
||||
else
|
||||
@@ -95,7 +96,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
// For variety, randomly assign a speed between min and max
|
||||
_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
|
||||
@@ -117,7 +118,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
// Calculate normalization factor based on screen height
|
||||
_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()
|
||||
@@ -147,7 +148,7 @@ namespace Minigames.DivingForPictures
|
||||
_isPaused = true;
|
||||
StopObstacleCoroutines();
|
||||
|
||||
Debug.Log($"[FloatingObstacle] Paused obstacle: {name}");
|
||||
Logging.Debug($"[FloatingObstacle] Paused obstacle: {name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -160,7 +161,7 @@ namespace Minigames.DivingForPictures
|
||||
_isPaused = false;
|
||||
StartObstacleCoroutines();
|
||||
|
||||
Debug.Log($"[FloatingObstacle] Resumed obstacle: {name}");
|
||||
Logging.Debug($"[FloatingObstacle] Resumed obstacle: {name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -221,7 +222,7 @@ namespace Minigames.DivingForPictures
|
||||
_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>
|
||||
@@ -229,7 +230,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
@@ -273,7 +274,7 @@ namespace Minigames.DivingForPictures
|
||||
if (_collider != null && _collider.enabled)
|
||||
{
|
||||
_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
|
||||
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();
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -328,14 +329,14 @@ namespace Minigames.DivingForPictures
|
||||
ObstacleSpawner foundSpawner = FindFirstObjectByType<ObstacleSpawner>();
|
||||
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.ReturnObstacleToPool(gameObject, prefabIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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);
|
||||
|
||||
// Move to a safe location to avoid interference
|
||||
@@ -368,7 +369,7 @@ namespace Minigames.DivingForPictures
|
||||
_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
|
||||
}
|
||||
@@ -387,7 +388,7 @@ namespace Minigames.DivingForPictures
|
||||
_collider.enabled = true;
|
||||
}
|
||||
|
||||
Debug.Log($"[FloatingObstacle] Obstacle {gameObject.name} despawned to pool");
|
||||
Logging.Debug($"[FloatingObstacle] Obstacle {gameObject.name} despawned to pool");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -427,7 +428,7 @@ namespace Minigames.DivingForPictures
|
||||
// Reverse movement speed (already handled by ObstacleSpawner, but this ensures consistency)
|
||||
moveSpeed *= -1;
|
||||
|
||||
Debug.Log($"[FloatingObstacle] {gameObject.name} started surfacing with speed: {moveSpeed}");
|
||||
Logging.Debug($"[FloatingObstacle] {gameObject.name} started surfacing with speed: {moveSpeed}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using Pooling;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
@@ -21,12 +22,12 @@ namespace Minigames.DivingForPictures
|
||||
FloatingObstacle obstacleComponent = obstacle.GetComponent<FloatingObstacle>();
|
||||
if (obstacleComponent != null)
|
||||
{
|
||||
Debug.Log($"[ObstaclePool] Returning obstacle {obstacle.name} to pool");
|
||||
Logging.Debug($"[ObstaclePool] Returning obstacle {obstacle.name} to pool");
|
||||
Return(obstacleComponent, prefabIndex);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -38,7 +39,7 @@ namespace Minigames.DivingForPictures
|
||||
/// <returns>An obstacle instance ready to use</returns>
|
||||
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);
|
||||
|
||||
if (obstacleComponent == null)
|
||||
@@ -47,7 +48,7 @@ namespace Minigames.DivingForPictures
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using UnityEngine.Events;
|
||||
using Pooling;
|
||||
using AppleHills.Core.Settings;
|
||||
using AppleHills.Core.Interfaces;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -119,7 +120,7 @@ namespace Minigames.DivingForPictures
|
||||
StartMoveCoroutine();
|
||||
StartDespawnCoroutine();
|
||||
|
||||
Debug.Log("[ObstacleSpawner] Initialized");
|
||||
Logging.Debug("[ObstacleSpawner] Initialized");
|
||||
}
|
||||
|
||||
/// <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>
|
||||
@@ -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>
|
||||
@@ -232,14 +233,14 @@ namespace Minigames.DivingForPictures
|
||||
// Check if the prefab has a FloatingObstacle component
|
||||
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>();
|
||||
}
|
||||
|
||||
// Ensure the prefab is on the correct layer (using configurable 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);
|
||||
}
|
||||
}
|
||||
@@ -319,7 +320,7 @@ namespace Minigames.DivingForPictures
|
||||
// Calculate spawn range based on 80% of screen width (40% on each side from center)
|
||||
_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>
|
||||
@@ -330,7 +331,7 @@ namespace Minigames.DivingForPictures
|
||||
if (_spawnCoroutine == null)
|
||||
{
|
||||
_spawnCoroutine = StartCoroutine(SpawnObstaclesCoroutine());
|
||||
Debug.Log("[ObstacleSpawner] Started spawning obstacles");
|
||||
Logging.Debug("[ObstacleSpawner] Started spawning obstacles");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +344,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
StopCoroutine(_spawnCoroutine);
|
||||
_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
|
||||
if (_isSurfacing)
|
||||
{
|
||||
Debug.Log("[ObstacleSpawner] Skipping obstacle spawn - currently surfacing");
|
||||
Logging.Debug("[ObstacleSpawner] Skipping obstacle spawn - currently surfacing");
|
||||
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)
|
||||
{
|
||||
Debug.LogWarning("[ObstacleSpawner] No obstacle prefabs available for spawning!");
|
||||
Logging.Warning("[ObstacleSpawner] No obstacle prefabs available for spawning!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -397,20 +398,20 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
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);
|
||||
foundValidPosition = true;
|
||||
break;
|
||||
}
|
||||
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)
|
||||
{
|
||||
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>
|
||||
private void SpawnObstacleAt(Vector3 position)
|
||||
{
|
||||
Debug.Log($"[ObstacleSpawner] SpawnObstacleAt called for position {position}");
|
||||
Logging.Debug($"[ObstacleSpawner] SpawnObstacleAt called for position {position}");
|
||||
|
||||
// Select random prefab
|
||||
int prefabIndex = Random.Range(0, obstaclePrefabs.Count);
|
||||
@@ -460,7 +461,7 @@ namespace Minigames.DivingForPictures
|
||||
// Spawn using pool or instantiate directly
|
||||
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);
|
||||
if (obstacle == null)
|
||||
{
|
||||
@@ -473,12 +474,12 @@ namespace Minigames.DivingForPictures
|
||||
obstacle.transform.rotation = prefab.transform.rotation;
|
||||
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
|
||||
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
|
||||
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
|
||||
{
|
||||
@@ -510,7 +511,7 @@ namespace Minigames.DivingForPictures
|
||||
}
|
||||
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);
|
||||
|
||||
// Configure the newly instantiated obstacle
|
||||
@@ -521,16 +522,16 @@ namespace Minigames.DivingForPictures
|
||||
_obstacleCounter++;
|
||||
string oldName = obstacle.name;
|
||||
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
|
||||
_activeObstacles.Add(obstacle);
|
||||
|
||||
// Invoke events
|
||||
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>
|
||||
@@ -567,7 +568,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
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
|
||||
_activeObstacles.Remove(obstacle);
|
||||
@@ -578,12 +579,12 @@ namespace Minigames.DivingForPictures
|
||||
// Return to pool or destroy
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[ObstacleSpawner] Destroying {obstacle.name} (pooling disabled)");
|
||||
Logging.Debug($"[ObstacleSpawner] Destroying {obstacle.name} (pooling disabled)");
|
||||
Destroy(obstacle);
|
||||
}
|
||||
}
|
||||
@@ -595,7 +596,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
// This method can no longer directly modify the settings
|
||||
// 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>
|
||||
@@ -605,7 +606,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
// This method can no longer directly modify the settings
|
||||
// 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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -675,7 +676,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
private IEnumerator SpawnObstacleRoutine()
|
||||
{
|
||||
Debug.Log("[ObstacleSpawner] Started spawning coroutine");
|
||||
Logging.Debug("[ObstacleSpawner] Started spawning coroutine");
|
||||
|
||||
while (enabled && gameObject.activeInHierarchy && !_isPaused && !_isSurfacing)
|
||||
{
|
||||
@@ -694,7 +695,7 @@ namespace Minigames.DivingForPictures
|
||||
// Clear coroutine reference when stopped
|
||||
_spawnCoroutine = null;
|
||||
|
||||
Debug.Log("[ObstacleSpawner] Spawning coroutine ended");
|
||||
Logging.Debug("[ObstacleSpawner] Spawning coroutine ended");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -704,7 +705,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
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
|
||||
while (enabled && gameObject.activeInHierarchy && !_isPaused)
|
||||
@@ -718,7 +719,7 @@ namespace Minigames.DivingForPictures
|
||||
// Clear coroutine reference when stopped
|
||||
_moveCoroutine = null;
|
||||
|
||||
Debug.Log("[ObstacleSpawner] Obstacle monitoring coroutine ended");
|
||||
Logging.Debug("[ObstacleSpawner] Obstacle monitoring coroutine ended");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -727,7 +728,7 @@ namespace Minigames.DivingForPictures
|
||||
private IEnumerator DespawnObstaclesRoutine()
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -808,7 +809,7 @@ namespace Minigames.DivingForPictures
|
||||
// Clear coroutine reference when stopped
|
||||
_despawnCoroutine = null;
|
||||
|
||||
Debug.Log("[ObstacleSpawner] Despawn coroutine ended");
|
||||
Logging.Debug("[ObstacleSpawner] Despawn coroutine ended");
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures.PictureCamera
|
||||
{
|
||||
@@ -206,7 +207,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
float canvasWidth = canvasRect.rect.width;
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -290,7 +291,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, targetScreenPosition, uiCamera,
|
||||
out targetAnchoredPosition);
|
||||
|
||||
Debug.Log(
|
||||
Logging.Debug(
|
||||
$"[CameraViewfinderManager] Target size (canvas): {targetViewfinderSize}, target anchored: {targetAnchoredPosition}");
|
||||
}
|
||||
|
||||
@@ -331,7 +332,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
bool[] thresholdTriggered = new bool[settings.ViewfinderProgressThresholds.Length];
|
||||
|
||||
// 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}");
|
||||
|
||||
// Verify the initial size is set correctly
|
||||
@@ -358,7 +359,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
// Additional check to ensure size is actually shrinking
|
||||
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}");
|
||||
// Force correct behavior
|
||||
curveValue = animationProgress; // Override with linear interpolation
|
||||
@@ -376,7 +377,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
// Log the animation state occasionally for debugging
|
||||
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}");
|
||||
}
|
||||
|
||||
@@ -401,7 +402,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
OnAnimationCompleted?.Invoke();
|
||||
|
||||
// Log final state to confirm we reached the target size
|
||||
Debug.Log(
|
||||
Logging.Debug(
|
||||
$"[CameraViewfinderManager] Animation completed: final size={viewfinderRectTransform.sizeDelta}");
|
||||
|
||||
yield return new WaitForSecondsRealtime(0.5f);
|
||||
@@ -471,7 +472,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
viewfinderInstance = null;
|
||||
viewfinderComponent = 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.anchoredPosition = Vector2.zero;
|
||||
|
||||
Debug.Log($"[CameraViewfinderManager] Showed full-screen viewfinder with size {canvasWidth}");
|
||||
Logging.Debug($"[CameraViewfinderManager] Showed full-screen viewfinder with size {canvasWidth}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -651,7 +652,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
bool[] thresholdTriggered = new bool[settings.ViewfinderProgressThresholds.Length];
|
||||
|
||||
// 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
|
||||
viewfinderRectTransform.sizeDelta = new Vector2(startSize, startSize);
|
||||
@@ -687,7 +688,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
// Log the animation state occasionally for debugging
|
||||
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}");
|
||||
}
|
||||
|
||||
@@ -752,7 +753,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
// Log the animation state occasionally for debugging
|
||||
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}");
|
||||
}
|
||||
|
||||
@@ -835,7 +836,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
{
|
||||
// Start the photo sequence when hold begins (same behavior as first tap in tap mode)
|
||||
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)
|
||||
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
|
||||
if (animationCoroutine != null)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
using Input;
|
||||
@@ -99,7 +100,7 @@ namespace Minigames.DivingForPictures.PictureCamera
|
||||
{
|
||||
// Fire the tap event that PhotoSequenceController will listen to
|
||||
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
|
||||
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
|
||||
OnViewfinderHoldEnded?.Invoke();
|
||||
Debug.Log($"[MDPI] Viewfinder OnHoldEnd: {position}");
|
||||
Logging.Debug($"[MDPI] Viewfinder OnHoldEnd: {position}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -32,7 +33,7 @@ namespace Minigames.DivingForPictures
|
||||
if (obstacle.gameObject.layer != _devSettings.ObstacleLayer)
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
|
||||
@@ -43,7 +44,7 @@ namespace Minigames.DivingForPictures
|
||||
obstacleComponent.MarkDamageDealt();
|
||||
}
|
||||
|
||||
Debug.Log($"[ObstacleCollision] Player hit by obstacle {obstacle.gameObject.name}");
|
||||
Logging.Debug($"[ObstacleCollision] Player hit by obstacle {obstacle.gameObject.name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -51,7 +52,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
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
|
||||
// The shared immunity system will handle the collision prevention
|
||||
@@ -62,7 +63,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -40,7 +41,7 @@ namespace Minigames.DivingForPictures
|
||||
targetSpriteRenderer = GetComponentInChildren<SpriteRenderer>();
|
||||
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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections;
|
||||
using AppleHills.Core.Settings;
|
||||
using AppleHills.Utilities;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -228,7 +229,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
playerController.enabled = false;
|
||||
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
|
||||
UpdateControllerTarget();
|
||||
|
||||
Debug.Log($"[{GetType().Name}] Player input restored after immunity");
|
||||
Logging.Debug($"[{GetType().Name}] Player input restored after immunity");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using AppleHills.Core.Settings;
|
||||
using Input;
|
||||
using AppleHillsCamera;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -59,11 +60,11 @@ namespace Minigames.DivingForPictures
|
||||
edgeAnchor = FindObjectOfType<EdgeAnchor>();
|
||||
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
|
||||
{
|
||||
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);
|
||||
|
||||
_isInitialized = true;
|
||||
Debug.Log("[PlayerController] Initialized");
|
||||
Logging.Debug("[PlayerController] Initialized");
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
@@ -120,7 +121,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
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);
|
||||
|
||||
// Calculate tap direction (+1 for right, -1 for left)
|
||||
@@ -141,7 +142,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
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);
|
||||
_isTouchActive = true;
|
||||
}
|
||||
@@ -151,7 +152,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -160,7 +161,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
public void OnHoldEnd(Vector2 worldPosition)
|
||||
{
|
||||
// Debug.Log($"[EndlessDescenderController] OnHoldEnd at {worldPosition}");
|
||||
// Logging.Debug($"[EndlessDescenderController] OnHoldEnd at {worldPosition}");
|
||||
_isTouchActive = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using GogoGaga.OptimizedRopesAndCables;
|
||||
using Core;
|
||||
using GogoGaga.OptimizedRopesAndCables;
|
||||
using UnityEngine;
|
||||
|
||||
public class RopeEndPhysicsFollower : MonoBehaviour
|
||||
@@ -46,7 +47,7 @@ public class RopeEndPhysicsFollower : MonoBehaviour
|
||||
if (targetTransform != null)
|
||||
{
|
||||
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))
|
||||
{
|
||||
@@ -54,7 +55,7 @@ public class RopeEndPhysicsFollower : MonoBehaviour
|
||||
if (found)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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
|
||||
{
|
||||
offset = Vector2.zero;
|
||||
lastTargetPosition = transform.position;
|
||||
if (debugLog) Debug.Log($"[RopeEndPhysicsFollower] No target found");
|
||||
if (debugLog) Logging.Debug($"[RopeEndPhysicsFollower] No target found");
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
@@ -124,7 +125,7 @@ public class RopeEndPhysicsFollower : MonoBehaviour
|
||||
// Debug log to track vertical hanging behavior
|
||||
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)
|
||||
{
|
||||
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
|
||||
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
|
||||
@@ -227,13 +228,13 @@ public class RopeEndPhysicsFollower : MonoBehaviour
|
||||
if (attachedRope != null)
|
||||
{
|
||||
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
|
||||
{
|
||||
// Default fallback value if no rope is found
|
||||
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)
|
||||
{
|
||||
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;
|
||||
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)
|
||||
{
|
||||
maxDistance = distance;
|
||||
if (debugLog) Debug.Log($"[RopeEndPhysicsFollower] Max distance manually set to: {maxDistance}");
|
||||
if (debugLog) Logging.Debug($"[RopeEndPhysicsFollower] Max distance manually set to: {maxDistance}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace Minigames.DivingForPictures
|
||||
if (obstacle.gameObject.layer != _devSettings.TrenchTileLayer)
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
|
||||
@@ -35,7 +36,7 @@ namespace Minigames.DivingForPictures
|
||||
break;
|
||||
}
|
||||
|
||||
Debug.Log($"[TileBumpCollision] Collision handled with {_devSettings.BumpMode} mode");
|
||||
Logging.Debug($"[TileBumpCollision] Collision handled with {_devSettings.BumpMode} mode");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -64,7 +65,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
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>
|
||||
@@ -82,7 +83,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
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>
|
||||
@@ -144,7 +145,7 @@ namespace Minigames.DivingForPictures
|
||||
_isBumping = false;
|
||||
_bumpCoroutine = null;
|
||||
|
||||
Debug.Log("[TileBumpCollision] Bump movement completed");
|
||||
Logging.Debug("[TileBumpCollision] Bump movement completed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using Pooling;
|
||||
|
||||
@@ -26,7 +27,7 @@ namespace Minigames.DivingForPictures
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using Pooling;
|
||||
using AppleHills.Core.Settings;
|
||||
using Utils;
|
||||
using AppleHills.Core.Interfaces;
|
||||
using Core;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
@@ -158,7 +159,7 @@ namespace Minigames.DivingForPictures
|
||||
// Check if the prefab has a Tile component
|
||||
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
|
||||
tilePrefabs[i].AddComponent<Tile>();
|
||||
}
|
||||
@@ -220,7 +221,7 @@ namespace Minigames.DivingForPictures
|
||||
_speedRampingCoroutine = null;
|
||||
}
|
||||
|
||||
Debug.Log("[TrenchTileSpawner] Paused");
|
||||
Logging.Debug("[TrenchTileSpawner] Paused");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -238,7 +239,7 @@ namespace Minigames.DivingForPictures
|
||||
StartTileSpawningCoroutine();
|
||||
StartSpeedRampingCoroutine();
|
||||
|
||||
Debug.Log("[TrenchTileSpawner] Resumed");
|
||||
Logging.Debug("[TrenchTileSpawner] Resumed");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -264,7 +265,7 @@ namespace Minigames.DivingForPictures
|
||||
StartTileSpawningCoroutine();
|
||||
StartSpeedRampingCoroutine();
|
||||
|
||||
Debug.Log("[TrenchTileSpawner] Initialized with normalized speed");
|
||||
Logging.Debug("[TrenchTileSpawner] Initialized with normalized speed");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -327,7 +328,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
// Fallback in case no renderer is found
|
||||
_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
|
||||
_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>
|
||||
@@ -466,7 +467,7 @@ namespace Minigames.DivingForPictures
|
||||
// Recalculate velocity immediately
|
||||
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>
|
||||
@@ -482,7 +483,7 @@ namespace Minigames.DivingForPictures
|
||||
// Reverse the active tiles array to maintain consistent indexing logic
|
||||
_activeTiles.Reverse();
|
||||
|
||||
Debug.Log("[TrenchTileSpawner] Started surfacing - reversed array order");
|
||||
Logging.Debug("[TrenchTileSpawner] Started surfacing - reversed array order");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -509,7 +510,7 @@ namespace Minigames.DivingForPictures
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
@@ -550,7 +551,7 @@ namespace Minigames.DivingForPictures
|
||||
private IEnumerator TileDestructionRoutine()
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -618,7 +619,7 @@ namespace Minigames.DivingForPictures
|
||||
private IEnumerator TileSpawningRoutine()
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -711,7 +712,7 @@ namespace Minigames.DivingForPictures
|
||||
private IEnumerator SpeedRampingRoutine()
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -887,7 +888,7 @@ namespace Minigames.DivingForPictures
|
||||
_activeTiles.Add(tile);
|
||||
_tileLastUsed[prefabIndex] = _spawnCounter++;
|
||||
_currentDepth++;
|
||||
Debug.Log($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
|
||||
Logging.Debug($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
|
||||
onTileSpawned?.Invoke(tile);
|
||||
|
||||
// --- FLOATING AREA STATE MANAGEMENT ---
|
||||
@@ -949,7 +950,7 @@ namespace Minigames.DivingForPictures
|
||||
}
|
||||
_activeTiles.Add(tile);
|
||||
_currentDepth++;
|
||||
Debug.Log($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
|
||||
Logging.Debug($"[TrenchTileSpawner] Current Depth: {_currentDepth}");
|
||||
onTileSpawned?.Invoke(tile);
|
||||
// Optionally update floating area state if needed
|
||||
Tile spawnedTile = tile.GetComponent<Tile>();
|
||||
@@ -1035,7 +1036,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
if (tile == null)
|
||||
{
|
||||
Debug.LogWarning("Attempted to get height of null tile!");
|
||||
Logging.Warning("Attempted to get height of null tile!");
|
||||
return DefaultTileHeight;
|
||||
}
|
||||
|
||||
@@ -1171,7 +1172,7 @@ namespace Minigames.DivingForPictures
|
||||
private IEnumerator TileDestructionCoroutine()
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -1248,7 +1249,7 @@ namespace Minigames.DivingForPictures
|
||||
private IEnumerator TileSpawningCoroutine()
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Pooling
|
||||
@@ -35,7 +36,7 @@ namespace Pooling
|
||||
CreateNew();
|
||||
}
|
||||
|
||||
Debug.Log($"[{GetType().Name}] Initialized with {initialPoolSize} objects");
|
||||
Logging.Debug($"[{GetType().Name}] Initialized with {initialPoolSize} objects");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -128,7 +129,7 @@ namespace Pooling
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
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>
|
||||
@@ -115,7 +116,7 @@ namespace Pooling
|
||||
// Try to get a valid object from the pool, cleaning up any destroyed objects
|
||||
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
|
||||
while (pooledObjects[prefabIndex].Count > 0)
|
||||
@@ -126,20 +127,20 @@ namespace Pooling
|
||||
// Check if the object is still valid (not destroyed)
|
||||
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
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
@@ -147,7 +148,7 @@ namespace Pooling
|
||||
{
|
||||
T prefab = prefabs[prefabIndex];
|
||||
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
|
||||
@@ -161,22 +162,22 @@ namespace Pooling
|
||||
// This prevents off-screen checks from triggering during spawn process
|
||||
Vector3 originalPosition = obj.transform.position;
|
||||
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);
|
||||
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
|
||||
IPoolable poolable = obj.GetComponent<IPoolable>();
|
||||
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();
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -297,7 +298,7 @@ namespace Pooling
|
||||
/// </summary>
|
||||
public virtual void LogPoolStats()
|
||||
{
|
||||
Debug.Log($"[{GetType().Name}] Total pooled objects: {totalPooledCount}/{totalMaxPoolSize}");
|
||||
Logging.Debug($"[{GetType().Name}] Total pooled objects: {totalPooledCount}/{totalMaxPoolSize}");
|
||||
|
||||
string prefabDetails = "";
|
||||
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
|
||||
|
||||
@@ -3,6 +3,7 @@ using Interactions;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace PuzzleS
|
||||
@@ -102,7 +103,7 @@ namespace PuzzleS
|
||||
}
|
||||
|
||||
// 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>
|
||||
@@ -118,7 +119,7 @@ namespace PuzzleS
|
||||
}
|
||||
|
||||
// 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>
|
||||
@@ -137,7 +138,7 @@ namespace PuzzleS
|
||||
}
|
||||
|
||||
// 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>
|
||||
@@ -156,7 +157,7 @@ namespace PuzzleS
|
||||
}
|
||||
|
||||
// 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>
|
||||
@@ -175,7 +176,7 @@ namespace PuzzleS
|
||||
}
|
||||
|
||||
// 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>
|
||||
@@ -194,7 +195,7 @@ namespace PuzzleS
|
||||
}
|
||||
|
||||
// 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>
|
||||
@@ -203,7 +204,7 @@ namespace PuzzleS
|
||||
public void UnlockStep()
|
||||
{
|
||||
_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
|
||||
if (puzzleIndicator != null)
|
||||
@@ -219,7 +220,7 @@ namespace PuzzleS
|
||||
|
||||
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
|
||||
{
|
||||
@@ -262,7 +263,7 @@ namespace PuzzleS
|
||||
public void LockStep()
|
||||
{
|
||||
_isUnlocked = false;
|
||||
Debug.Log($"[Puzzles] Step locked: {stepData?.stepId} on {gameObject.name}");
|
||||
Logging.Debug($"[Puzzles] Step locked: {stepData?.stepId} on {gameObject.name}");
|
||||
|
||||
// Hide indicator
|
||||
if (_indicator != null)
|
||||
@@ -296,7 +297,7 @@ namespace PuzzleS
|
||||
if (!_isUnlocked) return;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using AppleHills.Core.Settings; // Added for IInteractionSettings
|
||||
using AppleHills.Core.Settings;
|
||||
using Core; // Added for IInteractionSettings
|
||||
|
||||
namespace PuzzleS
|
||||
{
|
||||
@@ -86,7 +87,7 @@ namespace PuzzleS
|
||||
{
|
||||
SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||
|
||||
Debug.Log("[MDPI] OnSceneLoaded");
|
||||
Logging.Debug("[MDPI] OnSceneLoaded");
|
||||
_runtimeDependencies.Clear();
|
||||
BuildRuntimeDependencies();
|
||||
UnlockInitialSteps();
|
||||
@@ -173,7 +174,7 @@ namespace PuzzleS
|
||||
_unlockedSteps.Clear();
|
||||
BuildRuntimeDependencies();
|
||||
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;
|
||||
_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>
|
||||
@@ -198,10 +199,10 @@ namespace PuzzleS
|
||||
{
|
||||
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>
|
||||
@@ -213,7 +214,7 @@ namespace PuzzleS
|
||||
var initialSteps = PuzzleGraphUtility.FindInitialSteps(_runtimeDependencies);
|
||||
foreach (var step in initialSteps)
|
||||
{
|
||||
Debug.Log($"[Puzzles] Initial step unlocked: {step.stepId}");
|
||||
Logging.Debug($"[Puzzles] Initial step unlocked: {step.stepId}");
|
||||
UnlockStep(step);
|
||||
}
|
||||
|
||||
@@ -229,7 +230,7 @@ namespace PuzzleS
|
||||
// Check if all dependencies have been completed
|
||||
if (AreRuntimeDependenciesMet(step))
|
||||
{
|
||||
Debug.Log($"[Puzzles] Chain step unlocked: {step.stepId}");
|
||||
Logging.Debug($"[Puzzles] Chain step unlocked: {step.stepId}");
|
||||
UnlockStep(step);
|
||||
madeProgress = true;
|
||||
}
|
||||
@@ -245,7 +246,7 @@ namespace PuzzleS
|
||||
{
|
||||
if (_completedSteps.Contains(step)) return;
|
||||
_completedSteps.Add(step);
|
||||
Debug.Log($"[Puzzles] Step completed: {step.stepId}");
|
||||
Logging.Debug($"[Puzzles] Step completed: {step.stepId}");
|
||||
|
||||
// Broadcast completion
|
||||
OnStepCompleted?.Invoke(step);
|
||||
@@ -254,12 +255,12 @@ namespace PuzzleS
|
||||
{
|
||||
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);
|
||||
}
|
||||
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();
|
||||
@@ -292,7 +293,7 @@ namespace PuzzleS
|
||||
{
|
||||
behaviour.UnlockStep();
|
||||
}
|
||||
Debug.Log($"[Puzzles] Step unlocked: {step.stepId}");
|
||||
Logging.Debug($"[Puzzles] Step unlocked: {step.stepId}");
|
||||
|
||||
// Broadcast unlock
|
||||
OnStepUnlocked?.Invoke(step);
|
||||
@@ -305,7 +306,7 @@ namespace PuzzleS
|
||||
{
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Data.CardSystem;
|
||||
using Pixelplacement;
|
||||
using UnityEngine;
|
||||
@@ -251,7 +252,7 @@ namespace AppleHills.UI.CardSystem
|
||||
// Animate card to center of slot using Pixelplacement.Tween
|
||||
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>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Data.CardSystem;
|
||||
using Pixelplacement;
|
||||
using UnityEngine;
|
||||
@@ -137,7 +138,7 @@ namespace AppleHills.UI.CardSystem
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Data.CardSystem;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -168,7 +169,7 @@ namespace AppleHills.UI.CardSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("[CardAlbumUI] No booster packs available");
|
||||
Logging.Debug("[CardAlbumUI] No booster packs available");
|
||||
// TODO: Show "no boosters available" message
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using Data.CardSystem;
|
||||
using Pixelplacement;
|
||||
using UnityEngine;
|
||||
@@ -136,7 +137,7 @@ namespace AppleHills.UI.CardSystem
|
||||
/// </summary>
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
@@ -37,7 +38,7 @@ namespace AppleHills.UI.CardSystem
|
||||
/// </summary>
|
||||
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;
|
||||
|
||||
@@ -199,7 +200,7 @@ namespace AppleHills.UI.CardSystem
|
||||
public void OnShowAnimation()
|
||||
{
|
||||
// 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
|
||||
}
|
||||
|
||||
@@ -209,7 +210,7 @@ namespace AppleHills.UI.CardSystem
|
||||
public void OnMoveToBackpackAnimation()
|
||||
{
|
||||
// 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
|
||||
}
|
||||
|
||||
@@ -221,14 +222,14 @@ namespace AppleHills.UI.CardSystem
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
cardData = cardDefinition.CreateCardData();
|
||||
UpdateCardVisuals();
|
||||
|
||||
Debug.Log($"[CardUIElement] Created card from definition: {cardData.Name}");
|
||||
Logging.Debug($"[CardUIElement] Created card from definition: {cardData.Name}");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppleHills.UI.CardSystem
|
||||
@@ -49,7 +50,7 @@ namespace AppleHills.UI.CardSystem
|
||||
page.TransitionIn();
|
||||
|
||||
OnPageChanged?.Invoke(page);
|
||||
Debug.Log($"[UIPageController] Pushed page: {page.PageName}");
|
||||
Logging.Debug($"[UIPageController] Pushed page: {page.PageName}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -69,12 +70,12 @@ namespace AppleHills.UI.CardSystem
|
||||
UIPage previousPage = _pageStack.Peek();
|
||||
previousPage.TransitionIn();
|
||||
OnPageChanged?.Invoke(previousPage);
|
||||
Debug.Log($"[UIPageController] Popped to previous page: {previousPage.PageName}");
|
||||
Logging.Debug($"[UIPageController] Popped to previous page: {previousPage.PageName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
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
|
||||
_pageStack.Clear();
|
||||
OnPageChanged?.Invoke(null);
|
||||
Debug.Log("[UIPageController] Cleared page stack");
|
||||
Logging.Debug("[UIPageController] Cleared page stack");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace UI
|
||||
float displayProgress = Mathf.Min(steadyProgress, actualProgress);
|
||||
|
||||
// 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
|
||||
if (progressBarImage != null)
|
||||
@@ -159,7 +159,7 @@ namespace UI
|
||||
if (steadyProgress >= 1.0f && displayProgress >= 1.0f)
|
||||
{
|
||||
_animationComplete = true;
|
||||
Debug.Log("[LoadingScreen] Animation complete");
|
||||
Logging.Debug("[LoadingScreen] Animation complete");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace UI
|
||||
if (progressBarImage != null)
|
||||
{
|
||||
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
|
||||
@@ -180,7 +180,7 @@ namespace UI
|
||||
if (loadingScreenContainer != null)
|
||||
{
|
||||
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
|
||||
_onLoadingScreenFullyHidden?.Invoke();
|
||||
@@ -196,7 +196,7 @@ namespace UI
|
||||
/// </summary>
|
||||
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
|
||||
_loadingComplete = true;
|
||||
@@ -207,7 +207,7 @@ namespace UI
|
||||
if (loadingScreenContainer != null)
|
||||
{
|
||||
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
|
||||
_onLoadingScreenFullyHidden?.Invoke();
|
||||
@@ -216,7 +216,7 @@ namespace UI
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ public class MainMenu : MonoBehaviour
|
||||
public async void StartGame()
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace UI
|
||||
if(!isMainMenu)
|
||||
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>
|
||||
@@ -105,7 +105,7 @@ namespace UI
|
||||
InputManager.Instance.SetInputMode(InputMode.UI);
|
||||
OnGamePaused?.Invoke();
|
||||
|
||||
Debug.Log("[PauseMenu] Game Paused");
|
||||
Logging.Debug("[PauseMenu] Game Paused");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -124,7 +124,7 @@ namespace UI
|
||||
InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
||||
OnGameResumed?.Invoke();
|
||||
|
||||
Debug.Log("[PauseMenu] Game Resumed");
|
||||
Logging.Debug("[PauseMenu] Game Resumed");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -141,7 +141,7 @@ namespace UI
|
||||
public async void ExitToMainMenu()
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
@@ -156,6 +156,12 @@ namespace UI
|
||||
Application.Quit();
|
||||
#endif
|
||||
}
|
||||
|
||||
public async void ReloadLevel()
|
||||
{
|
||||
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
|
||||
await SceneManagerService.Instance.ReloadCurrentScene(progress);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a level based on the selection from a dropdown menu.
|
||||
@@ -168,7 +174,7 @@ namespace UI
|
||||
HidePauseMenu();
|
||||
|
||||
// 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)
|
||||
{
|
||||
case 0:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
|
||||
namespace Utils
|
||||
{
|
||||
@@ -42,7 +43,7 @@ namespace Utils
|
||||
var settings = GameManager.GetSettingsObject<IDivingMinigameSettings>();
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user