Make a generic booster pack giver

This commit is contained in:
Michal Pikulski
2025-12-15 11:59:40 +01:00
parent e2b74b1ea5
commit bb332933ec
64 changed files with 1228 additions and 312 deletions

View File

@@ -50,17 +50,95 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.MinigameBoosterGiver m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.MinigameBoosterGiver
visualContainer: {fileID: 8617171489468030463} visualContainer: {fileID: 8617171489468030463}
boosterImage: {fileID: 3680365639323743419} boosterImages:
- {fileID: 3680365639323743419}
- {fileID: 5158233508174186704}
- {fileID: 7317268573047108242}
glowImage: {fileID: 4006246129058447062} glowImage: {fileID: 4006246129058447062}
continueButton: {fileID: 2988510625873934392} continueButton: {fileID: 2988510625873934392}
hoverAmount: 20 hoverAmount: 20
hoverDuration: 1.5 hoverDuration: 1.5
glowPulseMin: 0.9
glowPulseMax: 1.1 glowPulseMax: 1.1
glowPulseDuration: 1.2 glowPulseDuration: 1.2
targetBottomLeftOffset: {x: 100, y: 100} targetBottomLeftOffset: {x: 100, y: 100}
disappearDuration: 0.8 tweenDuration: 0.8
delayBetweenTweens: 0.2
disappearScale: 0.2 disappearScale: 0.2
--- !u!1 &2046297132759770707
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7317268573047108242}
- component: {fileID: 1517670192630373747}
- component: {fileID: 5305697625789971173}
m_Layer: 0
m_Name: BoosterPack3
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7317268573047108242
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2046297132759770707}
m_LocalRotation: {x: -0, y: -0, z: -0.1100099, w: 0.9939306}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5109945643968698326}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -12.632}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 238, y: -17}
m_SizeDelta: {x: 411, y: 729}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1517670192630373747
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2046297132759770707}
m_CullTransparentMesh: 1
--- !u!114 &5305697625789971173
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2046297132759770707}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
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: 4365544765984126881, guid: 9dac643e78ad86e4988c11a92f9c7a6d, type: 3}
m_Type: 0
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!1 &2923535299741790846 --- !u!1 &2923535299741790846
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -90,6 +168,8 @@ RectTransform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 4006246129058447062} - {fileID: 4006246129058447062}
- {fileID: 5158233508174186704}
- {fileID: 7317268573047108242}
- {fileID: 3680365639323743419} - {fileID: 3680365639323743419}
m_Father: {fileID: 2499229096808986326} m_Father: {fileID: 2499229096808986326}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -245,7 +325,7 @@ RectTransform:
m_GameObject: {fileID: 5931931042366245593} m_GameObject: {fileID: 5931931042366245593}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1.2475, y: 1.2475, z: 1.2475}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 5109945643968698326} m_Father: {fileID: 5109945643968698326}
@@ -331,6 +411,81 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &8788253687944493288
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5158233508174186704}
- component: {fileID: 1995908186822098317}
- component: {fileID: 2737207390792197177}
m_Layer: 0
m_Name: BoosterPack2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5158233508174186704
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8788253687944493288}
m_LocalRotation: {x: -0, y: -0, z: 0.18369389, w: 0.9829835}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5109945643968698326}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 21.17}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -214, y: -67}
m_SizeDelta: {x: 411, y: 729}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1995908186822098317
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8788253687944493288}
m_CullTransparentMesh: 1
--- !u!114 &2737207390792197177
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8788253687944493288}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
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: 4365544765984126881, guid: 9dac643e78ad86e4988c11a92f9c7a6d, type: 3}
m_Type: 0
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!1 &8914844459546715980 --- !u!1 &8914844459546715980
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

File diff suppressed because one or more lines are too long

View File

@@ -209,7 +209,7 @@ GameObject:
- component: {fileID: 116234197} - component: {fileID: 116234197}
m_Layer: 5 m_Layer: 5
m_Name: UI m_Name: UI
m_TagString: Untagged m_TagString: MainCanvas
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
@@ -304,7 +304,6 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 471921060}
- {fileID: 341271022} - {fileID: 341271022}
- {fileID: 1450108938} - {fileID: 1450108938}
m_Father: {fileID: 0} m_Father: {fileID: 0}
@@ -372,7 +371,7 @@ MonoBehaviour:
midPointPosition: 0.5 midPointPosition: 0.5
--- !u!120 &173052727 --- !u!120 &173052727
LineRenderer: LineRenderer:
serializedVersion: 2 serializedVersion: 3
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
@@ -418,12 +417,13 @@ LineRenderer:
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_MaskInteraction: 0
m_Positions: m_Positions:
- {x: -0.15602553, y: 4.074945, z: 0} - {x: -0.15602553, y: 4.0749445, z: 0}
- {x: -0.1566351, y: 3.9736383, z: 0} - {x: -0.1566351, y: 3.9736378, z: 0}
- {x: -0.1572447, y: 3.8729858, z: 0} - {x: -0.1572447, y: 3.8729858, z: 0}
- {x: -0.15785426, y: 3.7729876, z: 0} - {x: -0.15785426, y: 3.7729874, z: 0}
- {x: -0.15846384, y: 3.673644, z: 0} - {x: -0.15846384, y: 3.6736438, z: 0}
- {x: -0.15907341, y: 3.5749545, z: 0} - {x: -0.15907341, y: 3.5749545, z: 0}
- {x: -0.15968299, y: 3.4769197, z: 0} - {x: -0.15968299, y: 3.4769197, z: 0}
- {x: -0.16029257, y: 3.379539, z: 0} - {x: -0.16029257, y: 3.379539, z: 0}
@@ -494,7 +494,6 @@ LineRenderer:
textureScale: {x: 1, y: 1} textureScale: {x: 1, y: 1}
shadowBias: 0.5 shadowBias: 0.5
generateLightingData: 0 generateLightingData: 0
m_MaskInteraction: 0
m_UseWorldSpace: 1 m_UseWorldSpace: 1
m_Loop: 0 m_Loop: 0
m_ApplyActiveColorSpace: 1 m_ApplyActiveColorSpace: 1
@@ -1115,6 +1114,7 @@ GameObject:
m_IsActive: 1 m_IsActive: 1
--- !u!212 &461301696 --- !u!212 &461301696
SpriteRenderer: SpriteRenderer:
serializedVersion: 2
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
@@ -1160,6 +1160,7 @@ SpriteRenderer:
m_SortingLayerID: 622133659 m_SortingLayerID: 622133659
m_SortingLayer: -1 m_SortingLayer: -1
m_SortingOrder: 0 m_SortingOrder: 0
m_MaskInteraction: 0
m_Sprite: {fileID: 5958968447627082961, guid: ad9b785acb09cb247ae2c8cd895863de, type: 3} m_Sprite: {fileID: 5958968447627082961, guid: ad9b785acb09cb247ae2c8cd895863de, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0
@@ -1169,7 +1170,6 @@ SpriteRenderer:
m_AdaptiveModeThreshold: 0.5 m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0 m_SpriteTileMode: 0
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0 m_SpriteSortPoint: 0
--- !u!4 &461301697 --- !u!4 &461301697
Transform: Transform:
@@ -1208,112 +1208,6 @@ Animator:
m_AllowConstantClipSamplingOptimization: 1 m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0 m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0 m_WriteDefaultValuesOnDisable: 0
--- !u!1001 &471921059
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 116234201}
m_Modifications:
- target: {fileID: 1439929750438628637, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_Name
value: MiniGameBoosterGiver
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8617171489468030463, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
--- !u!224 &471921060 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}
m_PrefabInstance: {fileID: 471921059}
m_PrefabAsset: {fileID: 0}
--- !u!1 &495116983 --- !u!1 &495116983
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1438,6 +1332,7 @@ Transform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &730962734 --- !u!212 &730962734
SpriteRenderer: SpriteRenderer:
serializedVersion: 2
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
@@ -1483,6 +1378,7 @@ SpriteRenderer:
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_MaskInteraction: 0
m_Sprite: {fileID: -8679947266657860767, guid: a6e77c94466133a488925fb29cb7b323, type: 3} m_Sprite: {fileID: -8679947266657860767, guid: a6e77c94466133a488925fb29cb7b323, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0
@@ -1492,7 +1388,6 @@ SpriteRenderer:
m_AdaptiveModeThreshold: 0.5 m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0 m_SpriteTileMode: 0
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0 m_SpriteSortPoint: 0
--- !u!1 &747976396 --- !u!1 &747976396
GameObject: GameObject:
@@ -1530,7 +1425,7 @@ Transform:
m_GameObject: {fileID: 747976396} m_GameObject: {fileID: 747976396}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3.197517, z: 0} m_LocalPosition: {x: 0, y: 3.1975174, z: 0}
m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574} m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
@@ -1745,6 +1640,7 @@ MonoBehaviour:
adjustOnScreenResize: 0 adjustOnScreenResize: 0
preserveOtherAxes: 1 preserveOtherAxes: 1
accountForObjectSize: 1 accountForObjectSize: 1
customAnchorPoint: {fileID: 0}
showVisualization: 1 showVisualization: 1
visualizationColor: {r: 1, g: 0, b: 1, a: 1} visualizationColor: {r: 1, g: 0, b: 1, a: 1}
showObjectBounds: 1 showObjectBounds: 1
@@ -2039,7 +1935,7 @@ MonoBehaviour:
midPointPosition: 0.5 midPointPosition: 0.5
--- !u!120 &1062017696 --- !u!120 &1062017696
LineRenderer: LineRenderer:
serializedVersion: 2 serializedVersion: 3
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
@@ -2085,13 +1981,14 @@ LineRenderer:
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_MaskInteraction: 0
m_Positions: m_Positions:
- {x: -0.15602553, y: 4.074945, z: 0} - {x: -0.15602553, y: 4.0749445, z: 0}
- {x: -0.11662118, y: 3.8796227, z: 0} - {x: -0.11662118, y: 3.8796222, z: 0}
- {x: -0.07721684, y: 3.7057447, z: 0} - {x: -0.07721684, y: 3.7057445, z: 0}
- {x: -0.03781248, y: 3.553311, z: 0} - {x: -0.03781248, y: 3.5533106, z: 0}
- {x: 0.0015918687, y: 3.4223218, z: 0} - {x: 0.0015918687, y: 3.4223216, z: 0}
- {x: 0.040996216, y: 3.3127768, z: 0} - {x: 0.040996216, y: 3.3127766, z: 0}
- {x: 0.08040057, y: 3.2246761, z: 0} - {x: 0.08040057, y: 3.2246761, z: 0}
- {x: 0.11980491, y: 3.15802, z: 0} - {x: 0.11980491, y: 3.15802, z: 0}
- {x: 0.15920927, y: 3.1128082, z: 0} - {x: 0.15920927, y: 3.1128082, z: 0}
@@ -2161,7 +2058,6 @@ LineRenderer:
textureScale: {x: 1, y: 1} textureScale: {x: 1, y: 1}
shadowBias: 0.5 shadowBias: 0.5
generateLightingData: 0 generateLightingData: 0
m_MaskInteraction: 0
m_UseWorldSpace: 1 m_UseWorldSpace: 1
m_Loop: 0 m_Loop: 0
m_ApplyActiveColorSpace: 1 m_ApplyActiveColorSpace: 1
@@ -2452,6 +2348,7 @@ MonoBehaviour:
m_VerticalAlignment: 256 m_VerticalAlignment: 256
m_textAlignment: 65535 m_textAlignment: 65535
m_characterSpacing: 0 m_characterSpacing: 0
m_characterHorizontalScale: 1
m_wordSpacing: 0 m_wordSpacing: 0
m_lineSpacing: 0 m_lineSpacing: 0
m_lineSpacingMax: 0 m_lineSpacingMax: 0
@@ -2759,7 +2656,7 @@ MonoBehaviour:
midPointPosition: 0.5 midPointPosition: 0.5
--- !u!120 &1435210810 --- !u!120 &1435210810
LineRenderer: LineRenderer:
serializedVersion: 2 serializedVersion: 3
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
@@ -2805,13 +2702,14 @@ LineRenderer:
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_MaskInteraction: 0
m_Positions: m_Positions:
- {x: -0.15602553, y: 4.074945, z: 0} - {x: -0.15602553, y: 4.0749445, z: 0}
- {x: -0.18956745, y: 3.8764977, z: 0} - {x: -0.18956745, y: 3.8764973, z: 0}
- {x: -0.22310936, y: 3.7000237, z: 0} - {x: -0.22310936, y: 3.7000234, z: 0}
- {x: -0.25665125, y: 3.5455213, z: 0} - {x: -0.25665125, y: 3.5455208, z: 0}
- {x: -0.29019317, y: 3.412991, z: 0} - {x: -0.29019317, y: 3.412991, z: 0}
- {x: -0.32373506, y: 3.302434, z: 0} - {x: -0.32373506, y: 3.3024337, z: 0}
- {x: -0.35727698, y: 3.2138486, z: 0} - {x: -0.35727698, y: 3.2138486, z: 0}
- {x: -0.39081886, y: 3.147236, z: 0} - {x: -0.39081886, y: 3.147236, z: 0}
- {x: -0.4243608, y: 3.1025963, z: 0} - {x: -0.4243608, y: 3.1025963, z: 0}
@@ -2881,7 +2779,6 @@ LineRenderer:
textureScale: {x: 1, y: 1} textureScale: {x: 1, y: 1}
shadowBias: 0.5 shadowBias: 0.5
generateLightingData: 0 generateLightingData: 0
m_MaskInteraction: 0
m_UseWorldSpace: 1 m_UseWorldSpace: 1
m_Loop: 0 m_Loop: 0
m_ApplyActiveColorSpace: 1 m_ApplyActiveColorSpace: 1
@@ -3207,6 +3104,7 @@ Transform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1834056338 --- !u!212 &1834056338
SpriteRenderer: SpriteRenderer:
serializedVersion: 2
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
@@ -3252,6 +3150,7 @@ SpriteRenderer:
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_MaskInteraction: 0
m_Sprite: {fileID: 7978092750934100789, guid: ae6ce5ebb60e1504ea6c9983c822e0cf, type: 3} m_Sprite: {fileID: 7978092750934100789, guid: ae6ce5ebb60e1504ea6c9983c822e0cf, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0
@@ -3261,7 +3160,6 @@ SpriteRenderer:
m_AdaptiveModeThreshold: 0.5 m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0 m_SpriteTileMode: 0
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0 m_SpriteSortPoint: 0
--- !u!4 &1886863732 stripped --- !u!4 &1886863732 stripped
Transform: Transform:
@@ -3478,6 +3376,7 @@ GameObject:
m_IsActive: 1 m_IsActive: 1
--- !u!212 &2005292374 --- !u!212 &2005292374
SpriteRenderer: SpriteRenderer:
serializedVersion: 2
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
@@ -3523,6 +3422,7 @@ SpriteRenderer:
m_SortingLayerID: -1132846201 m_SortingLayerID: -1132846201
m_SortingLayer: 1 m_SortingLayer: 1
m_SortingOrder: 10 m_SortingOrder: 10
m_MaskInteraction: 0
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3} m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 0} m_Color: {r: 1, g: 1, b: 1, a: 0}
m_FlipX: 0 m_FlipX: 0
@@ -3532,7 +3432,6 @@ SpriteRenderer:
m_AdaptiveModeThreshold: 0.5 m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0 m_SpriteTileMode: 0
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0 m_SpriteSortPoint: 0
--- !u!4 &2005292375 --- !u!4 &2005292375
Transform: Transform:

View File

@@ -3,6 +3,7 @@ using Core;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core.Settings;
namespace UI.CardSystem namespace UI.CardSystem
{ {

View File

@@ -4,6 +4,7 @@ using UnityEngine;
using System; using System;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Settings;
namespace UI.CardSystem.StateMachine namespace UI.CardSystem.StateMachine
{ {

View File

@@ -2,6 +2,7 @@
using Core.SaveLoad; using Core.SaveLoad;
using UnityEngine; using UnityEngine;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core.Settings;
using Pixelplacement; using Pixelplacement;
namespace UI.CardSystem.StateMachine.States namespace UI.CardSystem.StateMachine.States

View File

@@ -2,6 +2,7 @@
using UnityEngine; using UnityEngine;
using Core; using Core;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core.Settings;
namespace UI.CardSystem.StateMachine.States namespace UI.CardSystem.StateMachine.States
{ {

View File

@@ -2,6 +2,7 @@
using UnityEngine; using UnityEngine;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Settings;
namespace UI.CardSystem.StateMachine.States namespace UI.CardSystem.StateMachine.States
{ {

View File

@@ -3,6 +3,7 @@ using UnityEngine;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using AppleHills.Data.CardSystem; using AppleHills.Data.CardSystem;
using Core.Settings;
namespace UI.CardSystem.StateMachine.States namespace UI.CardSystem.StateMachine.States
{ {

View File

@@ -5,6 +5,7 @@ using UnityEngine.EventSystems;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using AppleHills.Data.CardSystem; using AppleHills.Data.CardSystem;
using Core; using Core;
using Core.Settings;
namespace UI.CardSystem.StateMachine.States namespace UI.CardSystem.StateMachine.States
{ {

View File

@@ -9,10 +9,9 @@ using UnityEngine.UI;
namespace UI.CardSystem namespace UI.CardSystem
{ {
/// <summary> /// <summary>
/// Singleton UI component for granting booster packs from minigames. /// UI component for granting booster packs from minigames.
/// Displays a booster pack with glow effect, waits for user to click continue, /// Supports awarding 1 to N booster packs with visual animations.
/// then shows the scrapbook button and animates the pack flying to it before granting the reward. /// Shows up to 3 booster packs visually. For more than 3, duplicates the first pack and tweens them sequentially.
/// The scrapbook button is automatically hidden after the animation completes.
/// </summary> /// </summary>
public class MinigameBoosterGiver : MonoBehaviour public class MinigameBoosterGiver : MonoBehaviour
{ {
@@ -20,8 +19,8 @@ namespace UI.CardSystem
[Header("Visual References")] [Header("Visual References")]
[SerializeField] private GameObject visualContainer; [SerializeField] private GameObject visualContainer;
[SerializeField] private RectTransform boosterImage; [SerializeField] private RectTransform[] boosterImages; // Up to 3 booster pack visuals
[SerializeField] private RectTransform glowImage; [SerializeField] private RectTransform glowImage; // Single glow effect for all boosters
[SerializeField] private Button continueButton; [SerializeField] private Button continueButton;
[Header("Animation Settings")] [Header("Animation Settings")]
@@ -32,14 +31,16 @@ namespace UI.CardSystem
[Header("Disappear Animation")] [Header("Disappear Animation")]
[SerializeField] private Vector2 targetBottomLeftOffset = new Vector2(100f, 100f); [SerializeField] private Vector2 targetBottomLeftOffset = new Vector2(100f, 100f);
[SerializeField] private float disappearDuration = 0.8f; [SerializeField] private float tweenDuration = 0.8f;
[SerializeField] private float delayBetweenTweens = 0.2f;
[SerializeField] private float disappearScale = 0.2f; [SerializeField] private float disappearScale = 0.2f;
private Vector3 _boosterInitialPosition; private Vector3[] _boosterInitialPositions;
private Vector3 _boosterInitialScale; private Vector3[] _boosterInitialScales;
private Vector3 _glowInitialScale; private Vector3 _glowInitialScale;
private Coroutine _currentSequence; private Coroutine _currentSequence;
private Action _onCompleteCallback; private Action _onCompleteCallback;
private int _totalPackCount = 1;
private void Awake() private void Awake()
{ {
@@ -53,11 +54,20 @@ namespace UI.CardSystem
Instance = this; Instance = this;
// Cache initial values // Cache initial values for all booster images
if (boosterImage != null) if (boosterImages != null && boosterImages.Length > 0)
{ {
_boosterInitialPosition = boosterImage.localPosition; _boosterInitialPositions = new Vector3[boosterImages.Length];
_boosterInitialScale = boosterImage.localScale; _boosterInitialScales = new Vector3[boosterImages.Length];
for (int i = 0; i < boosterImages.Length; i++)
{
if (boosterImages[i] != null)
{
_boosterInitialPositions[i] = boosterImages[i].localPosition;
_boosterInitialScales[i] = boosterImages[i].localScale;
}
}
} }
if (glowImage != null) if (glowImage != null)
@@ -78,6 +88,30 @@ namespace UI.CardSystem
} }
} }
/// <summary>
/// Initialize the booster giver with a specific pack count.
/// Shows up to 3 booster visuals based on count.
/// </summary>
/// <param name="packCount">Number of booster packs to grant</param>
public void Initialize(int packCount)
{
_totalPackCount = Mathf.Max(1, packCount);
// Show up to 3 booster visuals
int visualCount = Mathf.Min(_totalPackCount, boosterImages.Length);
for (int i = 0; i < boosterImages.Length; i++)
{
bool shouldShow = i < visualCount;
if (boosterImages[i] != null)
{
boosterImages[i].gameObject.SetActive(shouldShow);
}
}
Logging.Debug($"[MinigameBoosterGiver] Initialized with {_totalPackCount} packs, showing {visualCount} visuals");
}
private void OnDestroy() private void OnDestroy()
{ {
if (Instance == this) if (Instance == this)
@@ -115,13 +149,19 @@ namespace UI.CardSystem
visualContainer.SetActive(true); visualContainer.SetActive(true);
} }
// Reset positions and scales // Reset positions and scales for visible boosters
if (boosterImage != null) int visualCount = Mathf.Min(_totalPackCount, boosterImages.Length);
for (int i = 0; i < visualCount; i++)
{ {
boosterImage.localPosition = _boosterInitialPosition; if (boosterImages[i] != null)
boosterImage.localScale = _boosterInitialScale; {
boosterImages[i].localPosition = _boosterInitialPositions[i];
boosterImages[i].localScale = _boosterInitialScales[i];
}
} }
// Reset glow scale
if (glowImage != null) if (glowImage != null)
{ {
glowImage.localScale = _glowInitialScale; glowImage.localScale = _glowInitialScale;
@@ -133,14 +173,17 @@ namespace UI.CardSystem
continueButton.interactable = true; continueButton.interactable = true;
} }
// Start idle hovering animation on booster (ping-pong) // Start idle hovering animation on all visible boosters (ping-pong)
if (boosterImage != null) for (int i = 0; i < visualCount; i++)
{ {
Vector3 hoverTarget = _boosterInitialPosition + Vector3.up * hoverAmount; if (boosterImages[i] != null)
Tween.LocalPosition(boosterImage, hoverTarget, hoverDuration, 0f, Tween.EaseLinear, Tween.LoopType.PingPong); {
Vector3 hoverTarget = _boosterInitialPositions[i] + Vector3.up * hoverAmount;
Tween.LocalPosition(boosterImages[i], hoverTarget, hoverDuration, 0f, Tween.EaseLinear, Tween.LoopType.PingPong);
}
} }
// Start pulsing animation on glow (ping-pong scale) // Start pulsing animation on the single glow (ping-pong scale)
if (glowImage != null) if (glowImage != null)
{ {
Vector3 glowPulseScale = _glowInitialScale * glowPulseMax; Vector3 glowPulseScale = _glowInitialScale * glowPulseMax;
@@ -158,41 +201,23 @@ namespace UI.CardSystem
return; // Not in a sequence return; // Not in a sequence
} }
// Disable button to prevent double-clicks // Disable and hide button to prevent double-clicks
if (continueButton != null) if (continueButton != null)
{ {
continueButton.interactable = false; continueButton.interactable = false;
continueButton.gameObject.SetActive(false);
} }
// Stop the ongoing animations by stopping all tweens on these objects // Start moving all boosters to backpack
if (boosterImage != null) StartCoroutine(MoveAllBoostersToBackpack());
{
Tween.Stop(boosterImage.GetInstanceID());
}
if (glowImage != null)
{
Tween.Stop(glowImage.GetInstanceID());
// Fade out the glow
Tween.LocalScale(glowImage, Vector3.zero, disappearDuration * 0.5f, 0f, Tween.EaseInBack);
}
// Start disappear animation
StartCoroutine(DisappearSequence());
} }
private IEnumerator DisappearSequence() private IEnumerator MoveAllBoostersToBackpack()
{ {
if (boosterImage == null)
{
yield break;
}
// Show scrapbook button temporarily using HUD visibility context // Show scrapbook button temporarily using HUD visibility context
PlayerHudManager.HudVisibilityContext hudContext = null; PlayerHudManager.HudVisibilityContext hudContext = null;
GameObject scrapbookButton = null; GameObject scrapbookButton = PlayerHudManager.Instance?.GetScrabookButton();
scrapbookButton = PlayerHudManager.Instance.GetScrabookButton();
if (scrapbookButton != null) if (scrapbookButton != null)
{ {
hudContext = PlayerHudManager.Instance.ShowElementTemporarily(scrapbookButton); hudContext = PlayerHudManager.Instance.ShowElementTemporarily(scrapbookButton);
@@ -202,76 +227,87 @@ namespace UI.CardSystem
Logging.Warning("[MinigameBoosterGiver] Scrapbook button not found in PlayerHudManager."); Logging.Warning("[MinigameBoosterGiver] Scrapbook button not found in PlayerHudManager.");
} }
// Calculate target position - use scrapbook button position if available // Calculate target position once
Vector3 targetPosition; Vector3 targetPosition = GetTargetPosition(scrapbookButton);
if (scrapbookButton != null) int remaining = _totalPackCount;
int visualCount = Mathf.Min(_totalPackCount, boosterImages.Length);
// Stop and fade out the single glow immediately
if (glowImage != null)
{ {
// Get the scrapbook button's position in the same coordinate space as boosterImage Tween.Stop(glowImage.GetInstanceID());
RectTransform scrapbookRect = scrapbookButton.GetComponent<RectTransform>(); Tween.LocalScale(glowImage, Vector3.zero, tweenDuration * 0.5f, 0f, Tween.EaseInBack);
if (scrapbookRect != null)
{
// Convert scrapbook button's world position to local position relative to boosterImage's parent
Canvas canvas = GetComponentInParent<Canvas>();
if (canvas != null && canvas.renderMode == RenderMode.ScreenSpaceOverlay)
{
// For overlay canvas, convert screen position to local position
Vector2 screenPos = RectTransformUtility.WorldToScreenPoint(null, scrapbookRect.position);
RectTransformUtility.ScreenPointToLocalPointInRectangle(
boosterImage.parent as RectTransform,
screenPos,
null,
out Vector2 localPoint);
targetPosition = localPoint;
}
else
{
// For world space or camera canvas
targetPosition = boosterImage.parent.InverseTransformPoint(scrapbookRect.position);
}
}
else
{
Logging.Warning("[MinigameBoosterGiver] Scrapbook button has no RectTransform, using fallback position.");
targetPosition = GetFallbackPosition();
}
}
else
{
// Fallback to bottom-left corner
targetPosition = GetFallbackPosition();
} }
// Tween to scrapbook button position // Phase 1: Animate duplicates for packs above 3 (if any)
Tween.LocalPosition(boosterImage, targetPosition, disappearDuration, 0f, Tween.EaseInBack); int duplicatesToAnimate = Mathf.Max(0, _totalPackCount - 3);
// Scale down for (int i = 0; i < duplicatesToAnimate; i++)
Vector3 targetScale = _boosterInitialScale * disappearScale; {
Tween.LocalScale(boosterImage, targetScale, disappearDuration, 0f, Tween.EaseInBack); // Spawn duplicate at the first booster's current position
if (boosterImages.Length > 0 && boosterImages[0] != null)
{
StartCoroutine(TweenPackToBackpack(boosterImages[0], targetPosition, isDuplicate: true));
}
// Wait for animation to complete remaining--;
yield return new WaitForSeconds(disappearDuration);
// Grant the booster pack // Wait for stagger delay before next
if (i < duplicatesToAnimate - 1 || remaining > 0)
{
yield return new WaitForSeconds(delayBetweenTweens);
}
}
// Phase 2: Animate the actual visible packs (up to 3)
for (int i = 0; i < visualCount && i < remaining; i++)
{
if (boosterImages[i] != null)
{
// Stop hover animations first
Tween.Stop(boosterImages[i].GetInstanceID());
// Tween the actual booster
StartCoroutine(TweenPackToBackpack(boosterImages[i], targetPosition, isDuplicate: false));
}
// Wait for stagger delay before next (except after last one)
if (i < visualCount - 1 && i < remaining - 1)
{
yield return new WaitForSeconds(delayBetweenTweens);
}
}
// Wait for the last tween to complete
yield return new WaitForSeconds(tweenDuration);
// Grant all booster packs at once
if (CardSystemManager.Instance != null) if (CardSystemManager.Instance != null)
{ {
CardSystemManager.Instance.AddBoosterPack(1); CardSystemManager.Instance.AddBoosterPack(_totalPackCount);
Logging.Debug("[MinigameBoosterGiver] Booster pack granted!"); Logging.Debug($"[MinigameBoosterGiver] Granted {_totalPackCount} booster pack(s)!");
} }
else else
{ {
Logging.Warning("[MinigameBoosterGiver] CardSystemManager not found, cannot grant booster pack."); Logging.Warning("[MinigameBoosterGiver] CardSystemManager not found, cannot grant booster packs.");
} }
// Hide scrapbook button by disposing the context // Hide scrapbook button by disposing the context
hudContext?.Dispose(); hudContext?.Dispose();
// Hide the visual // Hide the visual container
if (visualContainer != null) if (visualContainer != null)
{ {
visualContainer.SetActive(false); visualContainer.SetActive(false);
} }
// Show button again for next use
if (continueButton != null)
{
continueButton.gameObject.SetActive(true);
}
// Invoke completion callback // Invoke completion callback
_onCompleteCallback?.Invoke(); _onCompleteCallback?.Invoke();
_onCompleteCallback = null; _onCompleteCallback = null;
@@ -280,6 +316,92 @@ namespace UI.CardSystem
_currentSequence = null; _currentSequence = null;
} }
/// <summary>
/// Generic method to tween a booster pack to the backpack button.
/// Handles both duplicates (instantiated clones) and actual booster visuals.
/// </summary>
private IEnumerator TweenPackToBackpack(RectTransform sourceRect, Vector3 targetPosition, bool isDuplicate)
{
RectTransform packToAnimate;
if (isDuplicate)
{
// Create a clone at the source position
GameObject clone = Instantiate(sourceRect.gameObject, sourceRect.parent);
packToAnimate = clone.GetComponent<RectTransform>();
if (packToAnimate != null)
{
packToAnimate.localPosition = sourceRect.localPosition;
packToAnimate.localScale = sourceRect.localScale;
packToAnimate.gameObject.SetActive(true);
}
}
else
{
packToAnimate = sourceRect;
}
if (packToAnimate == null)
{
yield break;
}
// Tween to target position
Tween.LocalPosition(packToAnimate, targetPosition, tweenDuration, 0f, Tween.EaseInBack);
// Scale down
Vector3 targetScale = packToAnimate.localScale * disappearScale;
Tween.LocalScale(packToAnimate, targetScale, tweenDuration, 0f, Tween.EaseInBack);
// Don't wait here - let animations overlap
// Hide/destroy the booster after tween completes (duplicate or not)
// Since we destroy the entire UI instance anyway, just clean up visual artifacts
yield return new WaitForSeconds(tweenDuration);
if (packToAnimate != null)
{
packToAnimate.gameObject.SetActive(false);
}
yield break;
}
/// <summary>
/// Get the target position for the booster pack animation (scrapbook button or fallback).
/// </summary>
private Vector3 GetTargetPosition(GameObject scrapbookButton)
{
if (scrapbookButton != null && boosterImages.Length > 0 && boosterImages[0] != null)
{
RectTransform scrapbookRect = scrapbookButton.GetComponent<RectTransform>();
if (scrapbookRect != null)
{
// Convert scrapbook button's world position to local position relative to booster's parent
Canvas canvas = GetComponentInParent<Canvas>();
if (canvas != null && canvas.renderMode == RenderMode.ScreenSpaceOverlay)
{
// For overlay canvas, convert screen position to local position
Vector2 screenPos = RectTransformUtility.WorldToScreenPoint(null, scrapbookRect.position);
RectTransformUtility.ScreenPointToLocalPointInRectangle(
boosterImages[0].parent as RectTransform,
screenPos,
null,
out Vector2 localPoint);
return localPoint;
}
else
{
// For world space or camera canvas
return boosterImages[0].parent.InverseTransformPoint(scrapbookRect.position);
}
}
}
// Fallback position
return GetFallbackPosition();
}
private Vector3 GetFallbackPosition() private Vector3 GetFallbackPosition()
{ {
RectTransform canvasRect = GetComponentInParent<Canvas>()?.GetComponent<RectTransform>(); RectTransform canvasRect = GetComponentInParent<Canvas>()?.GetComponent<RectTransform>();
@@ -292,7 +414,11 @@ namespace UI.CardSystem
else else
{ {
// Ultimate fallback if no canvas found // Ultimate fallback if no canvas found
return _boosterInitialPosition + new Vector3(-500f, -500f, 0f); if (boosterImages.Length > 0 && _boosterInitialPositions != null && _boosterInitialPositions.Length > 0)
{
return _boosterInitialPositions[0] + new Vector3(-500f, -500f, 0f);
}
return new Vector3(-500f, -500f, 0f);
} }
} }
} }

View File

@@ -307,6 +307,92 @@ namespace Core
} }
} }
/// <summary>
/// Displays the booster pack reward UI and grants the specified number of booster packs.
/// This method is awaitable and handles input mode switching automatically.
/// Supports awarding 1 to N booster packs with animated visuals.
/// </summary>
/// <param name="count">Number of booster packs to grant</param>
/// <returns>Task that completes when the UI sequence is finished</returns>
public async System.Threading.Tasks.Task GiveBoosterPacksAsync(int count)
{
Logging.Debug($"[GameManager] GiveBoosterPacksAsync called with count: {count}");
// Get prefab from settings
var settings = GetSettingsObject<ICardSystemSettings>();
if (settings?.BoosterPackRewardPrefab == null)
{
Logging.Warning("[GameManager] BoosterPackRewardPrefab not set in CardSystemSettings. Cannot show reward UI.");
return;
}
// Find main canvas
GameObject mainCanvasObj = GameObject.FindGameObjectWithTag("MainCanvas");
if (mainCanvasObj == null)
{
Logging.Warning("[GameManager] MainCanvas not found in scene. Cannot show reward UI.");
return;
}
// Switch to UI input mode
InputManager.Instance?.SetInputMode(InputMode.UI);
Logging.Debug("[GameManager] Switched to UI input mode");
// Instantiate UI prefab
GameObject uiInstance = Instantiate(settings.BoosterPackRewardPrefab);
var component = uiInstance.GetComponent<UI.CardSystem.MinigameBoosterGiver>();
if (component == null)
{
Logging.Warning("[GameManager] BoosterPackRewardPrefab does not have MinigameBoosterGiver component!");
Destroy(uiInstance);
InputManager.Instance?.SetInputMode(InputMode.GameAndUI);
return;
}
// Parent to main canvas and set stretch-fill anchoring
RectTransform rectTransform = uiInstance.GetComponent<RectTransform>();
if (rectTransform != null)
{
rectTransform.SetParent(mainCanvasObj.transform, false);
// Set anchors to stretch-fill (all corners)
rectTransform.anchorMin = Vector2.zero;
rectTransform.anchorMax = Vector2.one;
rectTransform.offsetMin = Vector2.zero;
rectTransform.offsetMax = Vector2.zero;
Logging.Debug("[GameManager] UI parented to MainCanvas with stretch-fill anchoring");
}
else
{
// Fallback: just parent without RectTransform adjustments
uiInstance.transform.SetParent(mainCanvasObj.transform, false);
Logging.Warning("[GameManager] UI does not have RectTransform, parented without anchor adjustment");
}
// Create TaskCompletionSource for awaiting
var tcs = new System.Threading.Tasks.TaskCompletionSource<bool>();
// Initialize the component with pack count
component.Initialize(count);
// Call GiveBooster to start the sequence
component.GiveBooster(() =>
{
Logging.Debug("[GameManager] Booster reward UI sequence completed");
Destroy(uiInstance);
tcs.SetResult(true);
});
// Await completion
await tcs.Task;
// Restore input mode to GameAndUI (default gameplay mode)
InputManager.Instance?.SetInputMode(InputMode.GameAndUI);
Logging.Debug("[GameManager] Restored to GameAndUI input mode");
}
// Helper method to get settings // Helper method to get settings
private T GetSettings<T>() where T : class private T GetSettings<T>() where T : class

View File

@@ -1,6 +1,7 @@
using UnityEngine; using AppleHills.Core.Settings;
using UnityEngine;
namespace AppleHills.Core.Settings namespace Core.Settings
{ {
/// <summary> /// <summary>
/// Settings for the card system - controls animations, interactions, and progression /// Settings for the card system - controls animations, interactions, and progression
@@ -47,6 +48,10 @@ namespace AppleHills.Core.Settings
[Tooltip("Default animation duration when not specified in seconds")] [Tooltip("Default animation duration when not specified in seconds")]
[SerializeField] private float defaultAnimationDuration = 0.3f; [SerializeField] private float defaultAnimationDuration = 0.3f;
[Header("UI Prefabs")]
[Tooltip("Prefab for the booster pack reward UI displayed after minigames")]
[SerializeField] private GameObject boosterPackRewardPrefab;
// ICardSystemSettings implementation - Idle Hover Animations // ICardSystemSettings implementation - Idle Hover Animations
public float IdleHoverHeight => idleHoverHeight; public float IdleHoverHeight => idleHoverHeight;
public float IdleHoverDuration => idleHoverDuration; public float IdleHoverDuration => idleHoverDuration;
@@ -70,6 +75,9 @@ namespace AppleHills.Core.Settings
// ICardSystemSettings implementation - General Animation // ICardSystemSettings implementation - General Animation
public float DefaultAnimationDuration => defaultAnimationDuration; public float DefaultAnimationDuration => defaultAnimationDuration;
// ICardSystemSettings implementation - UI Prefabs
public GameObject BoosterPackRewardPrefab => boosterPackRewardPrefab;
public override void OnValidate() public override void OnValidate()
{ {
base.OnValidate(); base.OnValidate();

View File

@@ -1,4 +1,5 @@
using UnityEngine; using Core.Settings;
using UnityEngine;
namespace AppleHills.Core.Settings namespace AppleHills.Core.Settings
{ {

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using Core.Settings;
using UnityEngine; using UnityEngine;
using Interactions; using Interactions;

View File

@@ -1,4 +1,5 @@
using UnityEngine; using Core.Settings;
using UnityEngine;
namespace AppleHills.Core.Settings namespace AppleHills.Core.Settings
{ {

View File

@@ -1,8 +1,9 @@
using UnityEngine; using System.Collections.Generic;
using System.Collections.Generic; using AppleHills.Core.Settings;
using Minigames.StatueDressup.Data; using Minigames.StatueDressup.Data;
using UnityEngine;
namespace AppleHills.Core.Settings namespace Core.Settings
{ {
/// <summary> /// <summary>
/// Enum defining the different input modes for photo taking /// Enum defining the different input modes for photo taking
@@ -177,6 +178,9 @@ namespace AppleHills.Core.Settings
// General Animation // General Animation
float DefaultAnimationDuration { get; } float DefaultAnimationDuration { get; }
// UI Prefabs
GameObject BoosterPackRewardPrefab { get; }
} }
/// <summary> /// <summary>
@@ -244,8 +248,8 @@ namespace AppleHills.Core.Settings
Common.Input.SlingshotConfig SlingshotSettings { get; } Common.Input.SlingshotConfig SlingshotSettings { get; }
// Block configurations // Block configurations
System.Collections.Generic.List<Minigames.FortFight.Settings.BlockMaterialConfig> MaterialConfigs { get; } List<Minigames.FortFight.Settings.BlockMaterialConfig> MaterialConfigs { get; }
System.Collections.Generic.List<Minigames.FortFight.Settings.BlockSizeConfig> SizeConfigs { get; } List<Minigames.FortFight.Settings.BlockSizeConfig> SizeConfigs { get; }
// AI Difficulty Settings // AI Difficulty Settings
Minigames.FortFight.Data.AIDifficulty DefaultAIDifficulty { get; } // Default difficulty level for AI Minigames.FortFight.Data.AIDifficulty DefaultAIDifficulty { get; } // Default difficulty level for AI
@@ -286,7 +290,7 @@ namespace AppleHills.Core.Settings
float CeilingFanDropSpeed { get; } // Downward velocity when dropping (m/s) float CeilingFanDropSpeed { get; } // Downward velocity when dropping (m/s)
// Projectile Configurations // Projectile Configurations
System.Collections.Generic.IReadOnlyList<Minigames.FortFight.Data.ProjectileConfig> ProjectileConfigs { get; } IReadOnlyList<Minigames.FortFight.Data.ProjectileConfig> ProjectileConfigs { get; }
Minigames.FortFight.Data.ProjectileConfig GetProjectileConfig(Minigames.FortFight.Data.ProjectileType type); Minigames.FortFight.Data.ProjectileConfig GetProjectileConfig(Minigames.FortFight.Data.ProjectileType type);
Minigames.FortFight.Data.ProjectileConfig GetProjectileConfigById(string projectileId); Minigames.FortFight.Data.ProjectileConfig GetProjectileConfigById(string projectileId);

View File

@@ -1,4 +1,5 @@
using Core; using Core;
using Core.Settings;
using UnityEngine; using UnityEngine;
namespace AppleHills namespace AppleHills
@@ -103,7 +104,7 @@ namespace AppleHills
} }
#endif #endif
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IInteractionSettings>(); var settings = GameManager.GetSettingsObject<IInteractionSettings>();
return settings?.InteractionOutlineColors; return settings?.InteractionOutlineColors;
} }

View File

@@ -3,6 +3,7 @@ using Pathfinding;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
namespace Input namespace Input
{ {

View File

@@ -6,6 +6,7 @@ using UnityEngine.SceneManagement;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
namespace Input namespace Input
{ {

View File

@@ -1,6 +1,7 @@
using UnityEngine; using UnityEngine;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Settings;
namespace Input namespace Input
{ {

View File

@@ -4,7 +4,8 @@ using UnityEngine;
using UnityEngine.Events; using UnityEngine.Events;
using System; // for Action<T> using System; // for Action<T>
using Core; // register with ItemManager using Core; // register with ItemManager
using AppleHills.Core.Settings; // Added for IInteractionSettings using AppleHills.Core.Settings;
using Core.Settings; // Added for IInteractionSettings
namespace Interactions namespace Interactions
{ {

View File

@@ -4,6 +4,7 @@ using Core;
using Input; using Input;
using Interactions; using Interactions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Core.Settings;
using UnityEngine; using UnityEngine;
namespace Levels namespace Levels

View File

@@ -4,6 +4,7 @@ using Core;
using Input; using Input;
using Interactions; using Interactions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Core.Settings;
using PuzzleS; using PuzzleS;
using UnityEngine; using UnityEngine;

View File

@@ -1,5 +1,6 @@
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Settings;
using Minigames.Airplane.Data; using Minigames.Airplane.Data;
namespace Minigames.Airplane.Abilities namespace Minigames.Airplane.Abilities

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections; using System.Collections;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using Minigames.Airplane.Abilities; using Minigames.Airplane.Abilities;
using Minigames.Airplane.Data; using Minigames.Airplane.Data;
using UnityEngine; using UnityEngine;
@@ -81,7 +82,7 @@ namespace Minigames.Airplane.Core
base.OnManagedAwake(); base.OnManagedAwake();
// Load settings // Load settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>(); var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
if (settings != null) if (settings != null)
{ {
mass = settings.AirplaneMass; mass = settings.AirplaneMass;
@@ -231,7 +232,7 @@ namespace Minigames.Airplane.Core
} }
// Check if it's ground (by layer) // Check if it's ground (by layer)
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>(); var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
if (settings != null && other.gameObject.layer == settings.GroundLayer) if (settings != null && other.gameObject.layer == settings.GroundLayer)
{ {
if (showDebugLogs) Logging.Debug($"[AirplaneController] Hit ground at Y={transform.position.y:F2}"); if (showDebugLogs) Logging.Debug($"[AirplaneController] Hit ground at Y={transform.position.y:F2}");
@@ -302,7 +303,7 @@ namespace Minigames.Airplane.Core
public void Initialize(AirplaneAbilityType abilityType) public void Initialize(AirplaneAbilityType abilityType)
{ {
// Get settings // Get settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>(); var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
if (settings == null) if (settings == null)
{ {
Logging.Error("[AirplaneController] Cannot initialize - settings not found!"); Logging.Error("[AirplaneController] Cannot initialize - settings not found!");

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections; using System.Collections;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using Minigames.Airplane.Data; using Minigames.Airplane.Data;
using UnityEngine; using UnityEngine;
@@ -261,7 +262,7 @@ namespace Minigames.Airplane.Core
Logging.Warning("[AirplaneGameManager] Using default airplane type from settings as fallback."); Logging.Warning("[AirplaneGameManager] Using default airplane type from settings as fallback.");
// Fallback: use default type from settings // Fallback: use default type from settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>(); var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
if (settings != null) if (settings != null)
{ {
_selectedAirplaneType = settings.DefaultAirplaneType; _selectedAirplaneType = settings.DefaultAirplaneType;

View File

@@ -2,6 +2,7 @@ using System;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Common.Input; using Common.Input;
using Core; using Core;
using Core.Settings;
using Minigames.Airplane.Data; using Minigames.Airplane.Data;
using UnityEngine; using UnityEngine;
@@ -142,7 +143,7 @@ namespace Minigames.Airplane.Core
} }
// Get settings and airplane config // Get settings and airplane config
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>(); var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
if (settings == null) if (settings == null)
{ {
Logging.Error("[AirplaneLaunchController] Cannot spawn - settings not found!"); Logging.Error("[AirplaneLaunchController] Cannot spawn - settings not found!");

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using Minigames.Airplane.Data; using Minigames.Airplane.Data;
using Minigames.Airplane.UI; using Minigames.Airplane.UI;
using UnityEngine; using UnityEngine;

View File

@@ -1,5 +1,6 @@
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Common.Input; using Common.Input;
using Core.Settings;
using UnityEngine; using UnityEngine;
namespace Minigames.Airplane.Settings namespace Minigames.Airplane.Settings

View File

@@ -1,5 +1,6 @@
using System; using System;
using Core; using Core;
using Core.Settings;
using Minigames.Airplane.Data; using Minigames.Airplane.Data;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
@@ -233,7 +234,7 @@ namespace Minigames.Airplane.UI
private void PopulateButtonIcons() private void PopulateButtonIcons()
{ {
// Get airplane settings // Get airplane settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>(); var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
if (settings == null) if (settings == null)
{ {
if (showDebugLogs) if (showDebugLogs)

View File

@@ -2,6 +2,7 @@
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Settings;
using UnityEngine; using UnityEngine;
using Random = UnityEngine.Random; using Random = UnityEngine.Random;

View File

@@ -1,5 +1,4 @@
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using AppleHills.Core.Settings;
using Cinematics; using Cinematics;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
@@ -8,10 +7,10 @@ using Minigames.DivingForPictures.PictureCamera;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Core.Settings;
using Minigames.DivingForPictures.Bubbles; using Minigames.DivingForPictures.Bubbles;
using UI.Core; using UI.Core;
using UnityEngine; using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Playables; using UnityEngine.Playables;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
@@ -664,40 +663,64 @@ namespace Minigames.DivingForPictures
_activeMonsters.Clear(); _activeMonsters.Clear();
// 1) Call the booster pack giver if available // Calculate booster pack reward based on pictures taken
bool completed = false; int boosterPackCount = CalculateBoosterPackReward();
var giver = UI.CardSystem.MinigameBoosterGiver.Instance; Logging.Debug($"[DivingGameManager] Pictures taken: {picturesTaken}, awarding {boosterPackCount} booster pack(s)");
if (giver != null)
// Show UI and grant booster packs using new async method
UIPageController.Instance.ShowAllUI();
Logging.Debug("[DivingGameManager] Starting booster giver sequence via GameManager");
// Use the new GameManager method to handle the booster pack reward
var task = GameManager.Instance.GiveBoosterPacksAsync(boosterPackCount);
// Wait for the task to complete
while (!task.IsCompleted)
{ {
UIPageController.Instance.ShowAllUI(); yield return null;
Logging.Debug("[DivingGameManager] Starting booster giver sequence"); }
giver.GiveBooster(() =>
{
completed = true;
Logging.Debug("[DivingGameManager] Booster giver completed callback received");
});
// 2) Wait for it to finish (NO timeout - wait indefinitely for user interaction) // Check for exceptions
while (!completed) if (task.IsFaulted)
{ {
yield return null; Logging.Warning($"[DivingGameManager] Booster pack reward failed: {task.Exception?.GetBaseException().Message}");
}
Logging.Debug("[DivingGameManager] Booster giver sequence finished, proceeding to game over");
} }
else else
{ {
// If no giver is present, proceed immediately Logging.Debug("[DivingGameManager] Booster giver sequence finished, proceeding to game over");
Logging.Debug("[DivingGameManager] MinigameBoosterGiver not found; skipping booster animation.");
} }
// 3) Only then show the game over screen // Show the game over screen
CinematicsManager.Instance.ShowGameOverScreen(); CinematicsManager.Instance.ShowGameOverScreen();
// Final score could be saved to player prefs or other persistence // Final score could be saved to player prefs or other persistence
Logging.Debug($"Final Score: {_playerScore}"); Logging.Debug($"Final Score: {_playerScore}");
} }
/// <summary>
/// Calculates how many booster packs to award based on the number of pictures taken.
/// </summary>
/// <returns>Number of booster packs to award</returns>
private int CalculateBoosterPackReward()
{
if (picturesTaken <= 3)
{
return 1;
}
else if (picturesTaken <= 5)
{
return 2;
}
else if (picturesTaken <= 10)
{
return 3;
}
else
{
return 4;
}
}
/// <summary> /// <summary>
/// Starts a smooth transition to the new velocity factor /// Starts a smooth transition to the new velocity factor
/// </summary> /// </summary>

View File

@@ -5,6 +5,7 @@ using Pooling;
using Utils; using Utils;
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using Core; using Core;
using Core.Settings;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {

View File

@@ -6,6 +6,7 @@ using Pooling;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using Core; using Core;
using Core.Settings;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures
{ {

View File

@@ -3,6 +3,7 @@ using System;
using System.Collections; using System.Collections;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Settings;
using UnityEngine.Audio; using UnityEngine.Audio;
namespace Minigames.DivingForPictures.PictureCamera namespace Minigames.DivingForPictures.PictureCamera

View File

@@ -4,6 +4,7 @@ using System.Collections;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using AppleHills.Utilities; using AppleHills.Utilities;
using Core; using Core;
using Core.Settings;
using Minigames.DivingForPictures.Player; using Minigames.DivingForPictures.Player;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures

View File

@@ -2,6 +2,7 @@
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using AppleHillsCamera; using AppleHillsCamera;
using Core; using Core;
using Core.Settings;
using Input; using Input;
using UnityEngine; using UnityEngine;

View File

@@ -7,6 +7,7 @@ using AppleHills.Core.Settings;
using Utils; using Utils;
using AppleHills.Core.Interfaces; using AppleHills.Core.Interfaces;
using Core; using Core;
using Core.Settings;
using Random = UnityEngine.Random; using Random = UnityEngine.Random;
namespace Minigames.DivingForPictures namespace Minigames.DivingForPictures

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using Minigames.FortFight.Core; using Minigames.FortFight.Core;
using Minigames.FortFight.Data; using Minigames.FortFight.Data;
using Minigames.FortFight.Fort; using Minigames.FortFight.Fort;
@@ -41,7 +42,7 @@ namespace Minigames.FortFight.AI
private ProjectileType _selectedAmmo; private ProjectileType _selectedAmmo;
// Settings cache // Settings cache
private AppleHills.Core.Settings.IFortFightSettings _cachedSettings; private IFortFightSettings _cachedSettings;
private AppleHills.Core.Settings.FortFightDeveloperSettings _cachedDevSettings; private AppleHills.Core.Settings.FortFightDeveloperSettings _cachedDevSettings;
private AIDifficultyData _currentDifficultyData; private AIDifficultyData _currentDifficultyData;
@@ -55,7 +56,7 @@ namespace Minigames.FortFight.AI
public void Initialize() public void Initialize()
{ {
// Load settings // Load settings
_cachedSettings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); _cachedSettings = GameManager.GetSettingsObject<IFortFightSettings>();
_cachedDevSettings = GameManager.GetDeveloperSettings<AppleHills.Core.Settings.FortFightDeveloperSettings>(); _cachedDevSettings = GameManager.GetDeveloperSettings<AppleHills.Core.Settings.FortFightDeveloperSettings>();
if (_cachedSettings == null) if (_cachedSettings == null)

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using Minigames.FortFight.Data; using Minigames.FortFight.Data;
using UnityEngine; using UnityEngine;

View File

@@ -2,6 +2,7 @@
using System.Linq; using System.Linq;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Common.Input; using Common.Input;
using Core.Settings;
using Minigames.FortFight.Data; using Minigames.FortFight.Data;
using Minigames.FortFight.Settings; using Minigames.FortFight.Settings;
using UnityEngine; using UnityEngine;

View File

@@ -1,5 +1,6 @@
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Settings;
using Minigames.FortFight.Data; using Minigames.FortFight.Data;
using Minigames.FortFight.Projectiles; using Minigames.FortFight.Projectiles;
using UnityEngine; using UnityEngine;

View File

@@ -2,6 +2,7 @@
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Common.Input; using Common.Input;
using Core; using Core;
using Core.Settings;
using Minigames.FortFight.Data; using Minigames.FortFight.Data;
using Minigames.FortFight.Projectiles; using Minigames.FortFight.Projectiles;
using UnityEngine; using UnityEngine;

View File

@@ -1,6 +1,7 @@
using System; using System;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using Minigames.FortFight.Data; using Minigames.FortFight.Data;
using UnityEngine; using UnityEngine;
@@ -178,7 +179,7 @@ namespace Minigames.FortFight.Core
{ {
transitionTimer += Time.deltaTime; transitionTimer += Time.deltaTime;
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
float transitionDelay = settings?.TurnTransitionDelay ?? 1.5f; float transitionDelay = settings?.TurnTransitionDelay ?? 1.5f;
if (transitionTimer >= transitionDelay) if (transitionTimer >= transitionDelay)

View File

@@ -1,6 +1,7 @@
using System; using System;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using UnityEngine; using UnityEngine;
using Minigames.FortFight.Data; using Minigames.FortFight.Data;
@@ -70,14 +71,14 @@ namespace Minigames.FortFight.Fort
private bool isDestroyed = false; private bool isDestroyed = false;
// Cached settings // Cached settings
private AppleHills.Core.Settings.IFortFightSettings _cachedSettings; private IFortFightSettings _cachedSettings;
private AppleHills.Core.Settings.IFortFightSettings CachedSettings private IFortFightSettings CachedSettings
{ {
get get
{ {
if (_cachedSettings == null) if (_cachedSettings == null)
{ {
_cachedSettings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); _cachedSettings = GameManager.GetSettingsObject<IFortFightSettings>();
} }
return _cachedSettings; return _cachedSettings;
} }
@@ -210,7 +211,7 @@ namespace Minigames.FortFight.Fort
{ {
if (spriteRenderer == null) return; if (spriteRenderer == null) return;
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
Color targetColor = settings?.DamageColorTint ?? new Color(0.5f, 0.5f, 0.5f); Color targetColor = settings?.DamageColorTint ?? new Color(0.5f, 0.5f, 0.5f);
// Darken sprite based on damage // Darken sprite based on damage

View File

@@ -5,6 +5,7 @@ using Core;
using Core.Lifecycle; using Core.Lifecycle;
using UnityEngine; using UnityEngine;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core.Settings;
namespace Minigames.FortFight.Fort namespace Minigames.FortFight.Fort
{ {

View File

@@ -1,5 +1,6 @@
using System.Collections; using System.Collections;
using Core; using Core;
using Core.Settings;
using UnityEngine; using UnityEngine;
namespace Minigames.FortFight.Projectiles namespace Minigames.FortFight.Projectiles
@@ -34,7 +35,7 @@ namespace Minigames.FortFight.Projectiles
private IEnumerator ActivationDelayCoroutine() private IEnumerator ActivationDelayCoroutine()
{ {
// Get activation delay from settings // Get activation delay from settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
float activationDelay = settings?.CeilingFanActivationDelay ?? 0.5f; float activationDelay = settings?.CeilingFanActivationDelay ?? 0.5f;
// Wait for delay // Wait for delay
@@ -82,7 +83,7 @@ namespace Minigames.FortFight.Projectiles
} }
// Get drop configuration from settings // Get drop configuration from settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
float dropDelay = settings?.CeilingFanDropDelay ?? 0.2f; float dropDelay = settings?.CeilingFanDropDelay ?? 0.2f;
float dropSpeed = settings?.CeilingFanDropSpeed ?? 20f; float dropSpeed = settings?.CeilingFanDropSpeed ?? 20f;

View File

@@ -1,6 +1,7 @@
using System; using System;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using Minigames.FortFight.Fort; using Minigames.FortFight.Fort;
using UnityEngine; using UnityEngine;
@@ -83,7 +84,7 @@ namespace Minigames.FortFight.Projectiles
ProjectileType = projectileType; ProjectileType = projectileType;
// Load damage and mass from settings // Load damage and mass from settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
if (settings != null) if (settings != null)
{ {
var config = settings.GetProjectileConfig(projectileType); var config = settings.GetProjectileConfig(projectileType);
@@ -120,7 +121,7 @@ namespace Minigames.FortFight.Projectiles
base.OnManagedAwake(); base.OnManagedAwake();
// Automatically assign projectile to correct layer from settings // Automatically assign projectile to correct layer from settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
if (settings != null && settings.ProjectileLayer >= 0 && gameObject.layer != settings.ProjectileLayer) if (settings != null && settings.ProjectileLayer >= 0 && gameObject.layer != settings.ProjectileLayer)
{ {
gameObject.layer = settings.ProjectileLayer; gameObject.layer = settings.ProjectileLayer;

View File

@@ -1,4 +1,5 @@
using Core; using Core;
using Core.Settings;
using UnityEngine; using UnityEngine;
namespace Minigames.FortFight.Projectiles namespace Minigames.FortFight.Projectiles
@@ -24,7 +25,7 @@ namespace Minigames.FortFight.Projectiles
} }
// Get settings for trash pieces // Get settings for trash pieces
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
int pieceCount = settings?.TrashBagPieceCount ?? 8; int pieceCount = settings?.TrashBagPieceCount ?? 8;
Logging.Debug($"[TrashBagProjectile] Splitting into {pieceCount} pieces"); Logging.Debug($"[TrashBagProjectile] Splitting into {pieceCount} pieces");
@@ -53,7 +54,7 @@ namespace Minigames.FortFight.Projectiles
} }
// Get settings // Get settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
int pieceCount = settings?.TrashBagPieceCount ?? 8; int pieceCount = settings?.TrashBagPieceCount ?? 8;
float pieceForce = settings?.TrashBagPieceForce ?? 10f; float pieceForce = settings?.TrashBagPieceForce ?? 10f;
float spreadAngle = settings?.TrashBagSpreadAngle ?? 60f; float spreadAngle = settings?.TrashBagSpreadAngle ?? 60f;

View File

@@ -1,4 +1,5 @@
using Core; using Core;
using Core.Settings;
using UnityEngine; using UnityEngine;
namespace Minigames.FortFight.Projectiles namespace Minigames.FortFight.Projectiles
@@ -19,7 +20,7 @@ namespace Minigames.FortFight.Projectiles
private void Start() private void Start()
{ {
// Get configuration from settings // Get configuration from settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
damage = settings?.TrashPieceDamage ?? 5f; damage = settings?.TrashPieceDamage ?? 5f;
float lifetime = settings?.TrashPieceLifetime ?? 5f; float lifetime = settings?.TrashPieceLifetime ?? 5f;

View File

@@ -1,4 +1,5 @@
using Core; using Core;
using Core.Settings;
using UnityEngine; using UnityEngine;
namespace Minigames.FortFight.Projectiles namespace Minigames.FortFight.Projectiles
@@ -26,7 +27,7 @@ namespace Minigames.FortFight.Projectiles
SpawnImpactEffect(collision.contacts[0].point); SpawnImpactEffect(collision.contacts[0].point);
// Get damage from settings // Get damage from settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
float blockDamage = settings?.VacuumBlockDamage ?? 999f; float blockDamage = settings?.VacuumBlockDamage ?? 999f;
// Deal high damage to destroy block instantly // Deal high damage to destroy block instantly
@@ -62,7 +63,7 @@ namespace Minigames.FortFight.Projectiles
isSliding = true; isSliding = true;
// Get settings // Get settings
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
if (settings != null) if (settings != null)
{ {
maxBlocksToDestroy = settings.VacuumDestroyBlockCount; maxBlocksToDestroy = settings.VacuumDestroyBlockCount;
@@ -85,7 +86,7 @@ namespace Minigames.FortFight.Projectiles
if (isSliding && rb2D != null) if (isSliding && rb2D != null)
{ {
// Set constant velocity in slide direction // Set constant velocity in slide direction
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
float slideSpeed = settings?.VacuumSlideSpeed ?? 10f; float slideSpeed = settings?.VacuumSlideSpeed ?? 10f;
rb2D.linearVelocity = slideDirection * slideSpeed; rb2D.linearVelocity = slideDirection * slideSpeed;

View File

@@ -1,5 +1,6 @@
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using Minigames.FortFight.Core; using Minigames.FortFight.Core;
using Minigames.FortFight.Data; using Minigames.FortFight.Data;
using UnityEngine; using UnityEngine;
@@ -97,7 +98,7 @@ namespace Minigames.FortFight.UI
// Get available projectile types from settings // Get available projectile types from settings
var availableTypes = AmmunitionManager.Instance.GetAvailableProjectileTypes(); var availableTypes = AmmunitionManager.Instance.GetAvailableProjectileTypes();
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>(); var settings = GameManager.GetSettingsObject<IFortFightSettings>();
if (settings == null) if (settings == null)
{ {

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using Minigames.StatueDressup.Data; using Minigames.StatueDressup.Data;
using UnityEngine; using UnityEngine;
using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.AsyncOperations;
@@ -18,7 +19,7 @@ namespace Minigames.StatueDressup.Controllers
// Static callback queue for when instance doesn't exist yet // Static callback queue for when instance doesn't exist yet
private static readonly List<System.Action> PendingCallbacks = new List<System.Action>(); private static readonly List<System.Action> PendingCallbacks = new List<System.Action>();
private AppleHills.Core.Settings.IStatueDressupSettings settings; private IStatueDressupSettings settings;
private Dictionary<string, DecorationData> decorationDataDict; private Dictionary<string, DecorationData> decorationDataDict;
private AsyncOperationHandle<System.Collections.Generic.IList<DecorationData>> decorationDataHandle; private AsyncOperationHandle<System.Collections.Generic.IList<DecorationData>> decorationDataHandle;
private bool isLoaded; private bool isLoaded;
@@ -26,7 +27,7 @@ namespace Minigames.StatueDressup.Controllers
/// <summary> /// <summary>
/// Get the settings instance /// Get the settings instance
/// </summary> /// </summary>
public AppleHills.Core.Settings.IStatueDressupSettings Settings => settings; public IStatueDressupSettings Settings => settings;
/// <summary> /// <summary>
/// Check if data is loaded and ready (implements IReadyNotifier) /// Check if data is loaded and ready (implements IReadyNotifier)
@@ -102,7 +103,7 @@ namespace Minigames.StatueDressup.Controllers
Logging.Debug("[DecorationDataManager] Waiting for GameManager to be accessible..."); Logging.Debug("[DecorationDataManager] Waiting for GameManager to be accessible...");
// Wait until GameManager is accessible and settings can be retrieved // Wait until GameManager is accessible and settings can be retrieved
settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IStatueDressupSettings>(); settings = GameManager.GetSettingsObject<IStatueDressupSettings>();
Logging.Debug("[DecorationDataManager] Settings loaded successfully"); Logging.Debug("[DecorationDataManager] Settings loaded successfully");

View File

@@ -1,4 +1,5 @@
using Minigames.StatueDressup.Data; using Core.Settings;
using Minigames.StatueDressup.Data;
using UnityEngine; using UnityEngine;
namespace Minigames.StatueDressup.DragDrop namespace Minigames.StatueDressup.DragDrop
@@ -37,7 +38,7 @@ namespace Minigames.StatueDressup.DragDrop
/// <summary> /// <summary>
/// Settings for the minigame /// Settings for the minigame
/// </summary> /// </summary>
public AppleHills.Core.Settings.IStatueDressupSettings Settings { get; set; } public IStatueDressupSettings Settings { get; set; }
/// <summary> /// <summary>
/// Callback when drag operation finishes (success or failure) /// Callback when drag operation finishes (success or failure)
@@ -67,7 +68,7 @@ namespace Minigames.StatueDressup.DragDrop
RectTransform statueOutline, RectTransform statueOutline,
Transform statueParent, Transform statueParent,
Controllers.StatueDecorationController controller, Controllers.StatueDecorationController controller,
AppleHills.Core.Settings.IStatueDressupSettings settings, IStatueDressupSettings settings,
System.Action onFinished, System.Action onFinished,
System.Action onShowOutline, System.Action onShowOutline,
System.Action onHideOutline) System.Action onHideOutline)
@@ -92,7 +93,7 @@ namespace Minigames.StatueDressup.DragDrop
public static DecorationDragContext CreateForPlaced( public static DecorationDragContext CreateForPlaced(
DecorationData data, DecorationData data,
Controllers.StatueDecorationController controller, Controllers.StatueDecorationController controller,
AppleHills.Core.Settings.IStatueDressupSettings settings, IStatueDressupSettings settings,
RectTransform statueOutline = null, RectTransform statueOutline = null,
Transform canvasParent = null, Transform canvasParent = null,
System.Action onShowOutline = null, System.Action onShowOutline = null,

View File

@@ -1,4 +1,5 @@
using Core; using Core;
using Core.Settings;
using Minigames.StatueDressup.Controllers; using Minigames.StatueDressup.Controllers;
using Minigames.StatueDressup.Data; using Minigames.StatueDressup.Data;
using Minigames.StatueDressup.Events; using Minigames.StatueDressup.Events;
@@ -28,7 +29,7 @@ namespace Minigames.StatueDressup.DragDrop
private RectTransform _statueOutline; private RectTransform _statueOutline;
private Transform _statueParent; private Transform _statueParent;
private StatueDecorationController _controller; private StatueDecorationController _controller;
private AppleHills.Core.Settings.IStatueDressupSettings _settings; private IStatueDressupSettings _settings;
private System.Action _onFinishedCallback; private System.Action _onFinishedCallback;
private System.Action _onShowOutlineCallback; private System.Action _onShowOutlineCallback;
private System.Action _onHideOutlineCallback; private System.Action _onHideOutlineCallback;
@@ -123,7 +124,7 @@ namespace Minigames.StatueDressup.DragDrop
/// </summary> /// </summary>
[System.Obsolete("Use InitializeWithContext instead")] [System.Obsolete("Use InitializeWithContext instead")]
public void Initialize(DecorationData data, RectTransform pStatueOutline, Transform pStatueParent, public void Initialize(DecorationData data, RectTransform pStatueOutline, Transform pStatueParent,
StatueDecorationController pController, AppleHills.Core.Settings.IStatueDressupSettings pSettings, StatueDecorationController pController, IStatueDressupSettings pSettings,
System.Action pOnFinishedCallback, System.Action onShowOutline = null, System.Action onHideOutline = null) System.Action pOnFinishedCallback, System.Action onShowOutline = null, System.Action onHideOutline = null)
{ {
var context = DecorationDragContext.CreateForNewDrag( var context = DecorationDragContext.CreateForNewDrag(
@@ -138,7 +139,7 @@ namespace Minigames.StatueDressup.DragDrop
/// </summary> /// </summary>
[System.Obsolete("Use InitializeWithContext instead")] [System.Obsolete("Use InitializeWithContext instead")]
public void InitializeAsPlaced(DecorationData data, StatueDecorationController pController, public void InitializeAsPlaced(DecorationData data, StatueDecorationController pController,
AppleHills.Core.Settings.IStatueDressupSettings pSettings, RectTransform pStatueOutline = null, IStatueDressupSettings pSettings, RectTransform pStatueOutline = null,
Transform pCanvasParent = null, System.Action onShowOutline = null, System.Action onHideOutline = null, Transform pCanvasParent = null, System.Action onShowOutline = null, System.Action onHideOutline = null,
System.Action onFinished = null) System.Action onFinished = null)
{ {

View File

@@ -1,4 +1,5 @@
using Core; using Core;
using Core.Settings;
using Minigames.StatueDressup.Controllers; using Minigames.StatueDressup.Controllers;
using Minigames.StatueDressup.DragDrop; using Minigames.StatueDressup.DragDrop;
using UnityEngine; using UnityEngine;
@@ -24,7 +25,7 @@ namespace Minigames.StatueDressup.UI
[SerializeField] private int activeDecorationSortOrder = 100; [SerializeField] private int activeDecorationSortOrder = 100;
private DecorationDraggableInstance _targetDecoration; private DecorationDraggableInstance _targetDecoration;
private AppleHills.Core.Settings.IStatueDressupSettings _settings; private IStatueDressupSettings _settings;
private bool _isInitialized; private bool _isInitialized;
// Canvas management for rendering order // Canvas management for rendering order

View File

@@ -2,6 +2,7 @@ using Core;
using UnityEngine; using UnityEngine;
using Input; using Input;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core.Settings;
namespace Minigames.TrashMaze.Core namespace Minigames.TrashMaze.Core
{ {

View File

@@ -3,6 +3,7 @@ using Minigames.TrashMaze.Core;
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core.Settings;
namespace Minigames.TrashMaze.Objects namespace Minigames.TrashMaze.Objects
{ {

View File

@@ -5,6 +5,7 @@ using Utils;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using UnityEngine.Events; using UnityEngine.Events;
/// <summary> /// <summary>

View File

@@ -7,6 +7,7 @@ using UnityEngine.SceneManagement;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Lifecycle; using Core.Lifecycle;
using Core.Settings;
using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.AsyncOperations;
using Utils; using Utils;

View File

@@ -3,6 +3,7 @@ using System.Linq;
using UnityEngine; using UnityEngine;
using AppleHills.Core.Settings; using AppleHills.Core.Settings;
using Core; using Core;
using Core.Settings;
using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.ResourceLocations; using UnityEngine.ResourceManagement.ResourceLocations;

View File

@@ -23,3 +23,4 @@ MonoBehaviour:
dragScale: 1.1 dragScale: 1.1
cardsToUpgrade: 5 cardsToUpgrade: 5
defaultAnimationDuration: 0.3 defaultAnimationDuration: 0.3
boosterPackRewardPrefab: {fileID: 1439929750438628637, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3}

View File

@@ -11,6 +11,7 @@ TagManager:
- Projectile - Projectile
- Target - Target
- MainCinemachineCamera - MainCinemachineCamera
- MainCanvas
layers: layers:
- Default - Default
- TransparentFX - TransparentFX