Stash half-assed work on testing scene

This commit is contained in:
Michal Pikulski
2025-11-12 11:58:01 +01:00
parent a9f102b3c4
commit 6fd1a10eb6
18 changed files with 3065 additions and 321 deletions

View File

@@ -92,27 +92,35 @@ For each state, follow this pattern:
1. Right-click `CardStateMachine`**Create Empty**
2. Name it `IdleState`
3. Add Component → **Card Idle State**
4. **No child visuals needed** for this state
#### 2. FlippingState
1. Right-click `CardStateMachine`**Create Empty**
2. Name it `FlippingState`
3. Add Component → **Card Flipping State**
4. **Create CardBackVisual child:**
- Right-click `FlippingState`**UI → Image**
- Right-click `IdleState`**UI → Image**
- Name it `CardBackVisual`
- Set **Anchors** to stretch-stretch
- Set **Left/Right/Top/Bottom** to `0`
- Assign your card back sprite to **Source Image**
- Drag this to **Card Back Visual** field on CardFlippingState component
- Drag this to **Card Back Visual** field on CardIdleState component
- **Note:** This state handles both idle behavior AND flip animation
#### 3. RevealedState
#### 2. RevealedState
1. Right-click `CardStateMachine`**Create Empty**
2. Name it `RevealedState`
3. Add Component → **Card Revealed State**
4. **No child visuals needed** for this state
4. **Create idle badge visuals:**
- Right-click `RevealedState`**Create Empty**
- Name it `NewCardIdleBadge`
- Add child **UI → Image** for small badge background
- Add child **UI → TextMeshProUGUI** for "NEW!" text
- Position at top-right corner (e.g., X offset +70, Y offset +100)
- Drag `NewCardIdleBadge` to **New Card Idle Badge** field
- Right-click `RevealedState`**Create Empty**
- Name it `RepeatCardIdleBadge`
- Add child **UI → Image** for small badge background
- Add child **UI → TextMeshProUGUI** for "REPEAT" text
- Position at top-right corner (same position as NEW badge)
- Drag `RepeatCardIdleBadge` to **Repeat Card Idle Badge** field
#### 4. EnlargedNewState
#### 3. EnlargedNewState
1. Right-click `CardStateMachine`**Create Empty**
2. Name it `EnlargedNewState`
3. Add Component → **Card Enlarged New State**
@@ -124,36 +132,34 @@ For each state, follow this pattern:
- Position badge at top of card (e.g., Y offset +100)
- Drag parent `NewCardBadge` to **New Card Badge** field on CardEnlargedNewState
#### 5. EnlargedRepeatState
#### 4. EnlargedRepeatState
1. Right-click `CardStateMachine`**Create Empty**
2. Name it `EnlargedRepeatState`
3. Add Component → **Card Enlarged Repeat State**
4. **Create ProgressBarUI child:**
- Right-click `EnlargedRepeatState`**Create Empty**
- Name it `ProgressBarContainer`
- Add child **UI → Image** for background bar
- Add child **UI → Image** for fill bar (set Image Type to **Filled**)
- Add child **UI → TextMeshProUGUI** for "X/5" text
- Right-click `EnlargedRepeatState`**Create Empty** (or drag your ProgressBarUI prefab)
- Name it `ProgressBarUI`
- Add **ProgressBarController** component to this GameObject
- Add **VerticalLayoutGroup** component (enable "Reverse Arrangement")
- Create 5 child **UI → Image** elements under ProgressBarUI
- Name them `ProgressElement1` through `ProgressElement5`
- Position at bottom of card (e.g., Y offset -100)
- Drag `ProgressBarContainer` to **Progress Bar Container** field
- Drag fill bar to **Progress Bar Fill** field
- Drag text to **Progress Text** field
- Set **Cards To Upgrade** to `5`
- Drag `ProgressBarController` component to **Progress Bar** field on CardEnlargedRepeatState
#### 6. DraggingState
#### 5. DraggingState
1. Right-click `CardStateMachine`**Create Empty**
2. Name it `DraggingState`
3. Add Component → **Card Dragging State**
4. Set **Drag Scale** to `1.1`
5. **No child visuals needed** for this state
#### 7. PlacedInSlotState
#### 6. PlacedInSlotState
1. Right-click `CardStateMachine`**Create Empty**
2. Name it `PlacedInSlotState`
3. Add Component → **Card Placed In Slot State**
4. **No child visuals needed** for this state
#### 8. AlbumEnlargedState
#### 7. AlbumEnlargedState
1. Right-click `CardStateMachine`**Create Empty**
2. Name it `AlbumEnlargedState`
3. Add Component → **Card Album Enlarged State**
@@ -293,23 +299,31 @@ Card (RectTransform)
└─ CardStateMachine
├─ [AppleMachine component]
├─ IdleState
─ [CardIdleState component]
├─ FlippingState
│ ├─ [CardFlippingState component]
─ [CardIdleState component]
│ └─ CardBackVisual (Image)
├─ RevealedState
─ [CardRevealedState component]
─ [CardRevealedState component]
│ ├─ NewCardIdleBadge
│ │ ├─ BadgeBackground (Image)
│ │ └─ BadgeText (TextMeshProUGUI - "NEW!")
│ └─ RepeatCardIdleBadge
│ ├─ BadgeBackground (Image)
│ └─ BadgeText (TextMeshProUGUI - "REPEAT")
├─ EnlargedNewState
│ ├─ [CardEnlargedNewState component]
│ └─ NewCardBadge
│ ├─ BadgeBackground (Image)
│ └─ BadgeText (TextMeshProUGUI)
│ └─ BadgeText (TextMeshProUGUI - "NEW CARD")
├─ EnlargedRepeatState
│ ├─ [CardEnlargedRepeatState component]
│ └─ ProgressBarContainer
│ ├─ BarBackground (Image)
│ ├─ BarFill (Image - Filled type)
CountText (TextMeshProUGUI)
│ └─ ProgressBarUI
│ ├─ [ProgressBarController component]
│ ├─ [VerticalLayoutGroup component - Reverse Arrangement]
ProgressElement1 (Image - 1/5)
│ ├─ ProgressElement2 (Image - 2/5)
│ ├─ ProgressElement3 (Image - 3/5)
│ ├─ ProgressElement4 (Image - 4/5)
│ └─ ProgressElement5 (Image - 5/5)
├─ DraggingState
│ └─ [CardDraggingState component]
├─ PlacedInSlotState
@@ -354,7 +368,7 @@ Card (RectTransform)
- [ ] Created CardAnimationConfig asset
- [ ] Created base Card prefab with all components
- [ ] Created all 8 state GameObjects under CardStateMachine
- [ ] Created all 7 state GameObjects under CardStateMachine
- [ ] Assigned state-owned visuals (CardBackVisual, NewCardBadge, ProgressBarUI)
- [ ] Wired up all component references
- [ ] Tested state transitions in Play mode
@@ -397,8 +411,8 @@ Card (RectTransform)
## Success Criteria
✅ Card prefab created with 8 functional states
✅ State transitions work (Idle → Flipping → Revealed, etc.)
✅ Card prefab created with 7 functional states
✅ State transitions work (Idle → Revealed → Enlarged, etc.)
✅ State-owned visuals activate/deactivate automatically
✅ Animations play correctly (flip, enlarge, hover)
✅ Click interactions work in all states