- **Refactored Card Placement Flow** - Separated card presentation from orchestration logic - Extracted `CornerCardManager` for pending card lifecycle (spawn, shuffle, rebuild) - Extracted `AlbumNavigationService` for book page navigation and zone mapping - Extracted `CardEnlargeController` for backdrop management and card reparenting - Implemented controller pattern (non-MonoBehaviour) for complex logic - Cards now unparent from slots before rebuild to prevent premature destruction - **Improved Corner Card Display** - Fixed cards spawning on top of each other during rebuild - Implemented shuffle-to-front logic (remaining cards occupy slots 0→1→2) - Added smart card selection (prioritizes cards matching current album page) - Pending cards now removed from queue immediately on drag start - Corner cards rebuild after each placement with proper slot reassignment - **Enhanced Album Card Viewing** - Added dramatic scale increase when viewing cards from album slots - Implemented shrink animation when dismissing enlarged cards - Cards transition: `PlacedInSlotState` → `AlbumEnlargedState` → `PlacedInSlotState` - Backdrop shows/hides with card enlarge/shrink cycle - Cards reparent to enlarged container while viewing, return to slot after - **State Machine Improvements** - Added `CardStateNames` constants for type-safe state transitions - Implemented `ICardClickHandler` and `ICardStateDragHandler` interfaces - State transitions now use cached property indices - `BoosterCardContext` separated from `CardContext` for single responsibility - **Code Cleanup** - Identified unused `SlotContainerHelper.cs` (superseded by `CornerCardManager`) - Identified unused `BoosterPackDraggable.canOpenOnDrop` field - Identified unused `AlbumViewPage._previousInputMode` (hardcoded value) - Identified unused `Card.OnPlacedInAlbumSlot` event (no subscribers) Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com> Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com> Reviewed-on: #59
188 lines
5.6 KiB
Plaintext
188 lines
5.6 KiB
Plaintext
%YAML 1.1
|
|
%TAG !u! tag:unity3d.com,2011:
|
|
--- !u!1 &3676527493138140132
|
|
GameObject:
|
|
m_ObjectHideFlags: 0
|
|
m_CorrespondingSourceObject: {fileID: 0}
|
|
m_PrefabInstance: {fileID: 0}
|
|
m_PrefabAsset: {fileID: 0}
|
|
serializedVersion: 6
|
|
m_Component:
|
|
- component: {fileID: 8845385832003591182}
|
|
- component: {fileID: 4571551530005540356}
|
|
- component: {fileID: 5228938363013129740}
|
|
m_Layer: 5
|
|
m_Name: BackgroundImage
|
|
m_TagString: Untagged
|
|
m_Icon: {fileID: 0}
|
|
m_NavMeshLayer: 0
|
|
m_StaticEditorFlags: 0
|
|
m_IsActive: 1
|
|
--- !u!224 &8845385832003591182
|
|
RectTransform:
|
|
m_ObjectHideFlags: 0
|
|
m_CorrespondingSourceObject: {fileID: 0}
|
|
m_PrefabInstance: {fileID: 0}
|
|
m_PrefabAsset: {fileID: 0}
|
|
m_GameObject: {fileID: 3676527493138140132}
|
|
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: 8880693373090345290}
|
|
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 &4571551530005540356
|
|
CanvasRenderer:
|
|
m_ObjectHideFlags: 0
|
|
m_CorrespondingSourceObject: {fileID: 0}
|
|
m_PrefabInstance: {fileID: 0}
|
|
m_PrefabAsset: {fileID: 0}
|
|
m_GameObject: {fileID: 3676527493138140132}
|
|
m_CullTransparentMesh: 1
|
|
--- !u!114 &5228938363013129740
|
|
MonoBehaviour:
|
|
m_ObjectHideFlags: 0
|
|
m_CorrespondingSourceObject: {fileID: 0}
|
|
m_PrefabInstance: {fileID: 0}
|
|
m_PrefabAsset: {fileID: 0}
|
|
m_GameObject: {fileID: 3676527493138140132}
|
|
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: 0.3018868, g: 0.3018868, b: 0.3018868, 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: 1371845613413874417, guid: ee00b57d42ea1d545bc75775545d86e7, 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 &3697348702925017591
|
|
GameObject:
|
|
m_ObjectHideFlags: 0
|
|
m_CorrespondingSourceObject: {fileID: 0}
|
|
m_PrefabInstance: {fileID: 0}
|
|
m_PrefabAsset: {fileID: 0}
|
|
serializedVersion: 6
|
|
m_Component:
|
|
- component: {fileID: 8576570241677955255}
|
|
- component: {fileID: 2515648508668674600}
|
|
- component: {fileID: 5397984527285824388}
|
|
m_Layer: 5
|
|
m_Name: AlbumCardSlot
|
|
m_TagString: Untagged
|
|
m_Icon: {fileID: 0}
|
|
m_NavMeshLayer: 0
|
|
m_StaticEditorFlags: 0
|
|
m_IsActive: 1
|
|
--- !u!224 &8576570241677955255
|
|
RectTransform:
|
|
m_ObjectHideFlags: 0
|
|
m_CorrespondingSourceObject: {fileID: 0}
|
|
m_PrefabInstance: {fileID: 0}
|
|
m_PrefabAsset: {fileID: 0}
|
|
m_GameObject: {fileID: 3697348702925017591}
|
|
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: 8880693373090345290}
|
|
m_Father: {fileID: 0}
|
|
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: 0}
|
|
m_SizeDelta: {x: 0, y: 540}
|
|
m_Pivot: {x: 0.5, y: 0.5}
|
|
--- !u!114 &2515648508668674600
|
|
MonoBehaviour:
|
|
m_ObjectHideFlags: 0
|
|
m_CorrespondingSourceObject: {fileID: 0}
|
|
m_PrefabInstance: {fileID: 0}
|
|
m_PrefabAsset: {fileID: 0}
|
|
m_GameObject: {fileID: 3697348702925017591}
|
|
m_Enabled: 1
|
|
m_EditorHideFlags: 0
|
|
m_Script: {fileID: 11500000, guid: 514a349ba18d4842bc4292cb034f0d76, type: 3}
|
|
m_Name:
|
|
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.AlbumCardSlot
|
|
slotIndex: -1
|
|
isLocked: 0
|
|
hideImageOnPlay: 0
|
|
filterByType: 0
|
|
allowedTypeNames: []
|
|
occupantSizeMode: 0
|
|
occupantScale: {x: 1, y: 1, z: 1}
|
|
scaleTransitionDuration: 0.3
|
|
targetCardDefinition: {fileID: 0}
|
|
cardPrefab: {fileID: 7504168507910195884, guid: c1795924899c08343a189300904ed424, type: 3}
|
|
--- !u!114 &5397984527285824388
|
|
MonoBehaviour:
|
|
m_ObjectHideFlags: 0
|
|
m_CorrespondingSourceObject: {fileID: 0}
|
|
m_PrefabInstance: {fileID: 0}
|
|
m_PrefabAsset: {fileID: 0}
|
|
m_GameObject: {fileID: 3697348702925017591}
|
|
m_Enabled: 1
|
|
m_EditorHideFlags: 0
|
|
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
|
|
m_Name:
|
|
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.AspectRatioFitter
|
|
m_AspectMode: 2
|
|
m_AspectRatio: 0.7407407
|
|
--- !u!1 &3957516808955976615
|
|
GameObject:
|
|
m_ObjectHideFlags: 0
|
|
m_CorrespondingSourceObject: {fileID: 0}
|
|
m_PrefabInstance: {fileID: 0}
|
|
m_PrefabAsset: {fileID: 0}
|
|
serializedVersion: 6
|
|
m_Component:
|
|
- component: {fileID: 8880693373090345290}
|
|
m_Layer: 5
|
|
m_Name: Visuals
|
|
m_TagString: Untagged
|
|
m_Icon: {fileID: 0}
|
|
m_NavMeshLayer: 0
|
|
m_StaticEditorFlags: 0
|
|
m_IsActive: 1
|
|
--- !u!224 &8880693373090345290
|
|
RectTransform:
|
|
m_ObjectHideFlags: 0
|
|
m_CorrespondingSourceObject: {fileID: 0}
|
|
m_PrefabInstance: {fileID: 0}
|
|
m_PrefabAsset: {fileID: 0}
|
|
m_GameObject: {fileID: 3957516808955976615}
|
|
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: 8845385832003591182}
|
|
m_Father: {fileID: 8576570241677955255}
|
|
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}
|