212 lines
4.6 KiB
Markdown
212 lines
4.6 KiB
Markdown
# Airplane Abilities - Unity Setup Quick Reference
|
||
|
||
**⚡ Fast setup guide for in-engine configuration**
|
||
|
||
---
|
||
|
||
## 🎯 7 Steps to Complete Setup
|
||
|
||
### **1️⃣ CREATE ABILITIES** (3 assets)
|
||
|
||
```
|
||
Project Window → Right-Click → Create → AppleHills → Airplane → Abilities
|
||
```
|
||
|
||
| Asset | Name | Cooldown | Key Values |
|
||
|-------|------|----------|------------|
|
||
| Jet | `JetAbility` | 5s | Speed: 15, Angle: 0 |
|
||
| Bobbing | `BobbingAbility` | 3s | Jump: 10, Speed Reduction: 0.7 |
|
||
| Drop | `DropAbility` | 4s | Force: 20, Distance: 5 |
|
||
|
||
✅ Assign icon sprites to each
|
||
|
||
---
|
||
|
||
### **2️⃣ CREATE AIRPLANE TYPES** (3 assets)
|
||
|
||
```
|
||
Project Window → Right-Click → Create → AppleHills → Airplane → Airplane Type
|
||
```
|
||
|
||
| Type | Name | Display Name | Ability |
|
||
|------|------|--------------|---------|
|
||
| Jet | `JetPlaneType` | "Jet Plane" | JetAbility |
|
||
| Bobbing | `BobbingPlaneType` | "Bobbing Plane" | BobbingAbility |
|
||
| Drop | `DropPlaneType` | "Drop Plane" | DropAbility |
|
||
|
||
✅ Assign prefabs and preview sprites
|
||
|
||
---
|
||
|
||
### **3️⃣ BUILD SELECTION UI**
|
||
|
||
**Hierarchy Path**: `Canvas/AirplaneSelectionPanel`
|
||
|
||
```
|
||
AirplaneSelectionPanel (+ AirplaneSelectionUI component)
|
||
├── TitleText ("Choose Your Airplane")
|
||
├── JetPlaneButton
|
||
├── BobbingPlaneButton
|
||
├── DropPlaneButton
|
||
└── ConfirmButton
|
||
```
|
||
|
||
**Component Setup**:
|
||
- Assign 3 button references
|
||
- Assign 3 airplane type assets
|
||
- Selected Color: Yellow
|
||
- Normal Color: White
|
||
- ✅ **Start inactive**
|
||
|
||
---
|
||
|
||
### **4️⃣ BUILD ABILITY BUTTON**
|
||
|
||
**Hierarchy Path**: `Canvas/GameplayUI/AbilityButton`
|
||
|
||
```
|
||
AbilityButton (+ AirplaneAbilityButton component)
|
||
├── Background (Image)
|
||
├── AbilityIcon (Image - dynamic)
|
||
├── CooldownFill (Image - Radial 360)
|
||
└── CooldownText (TextMeshPro - optional)
|
||
```
|
||
|
||
**Component Setup**:
|
||
- Assign Button, Icon, Fill, Text
|
||
- Ready: White, Cooldown: Gray, Active: Yellow
|
||
- ✅ **Start inactive**
|
||
|
||
---
|
||
|
||
### **5️⃣ WIRE GAME MANAGER**
|
||
|
||
**GameObject**: `AirplaneGameManager`
|
||
|
||
**New References**:
|
||
- Selection UI → AirplaneSelectionPanel
|
||
- Ability Button → AbilityButton
|
||
|
||
✅ Verify existing references still assigned
|
||
|
||
---
|
||
|
||
### **6️⃣ UPDATE SETTINGS**
|
||
|
||
**Asset**: `AirplaneSettings` (existing)
|
||
|
||
**New Field**:
|
||
- Default Airplane Type → Assign `JetPlaneType`
|
||
|
||
---
|
||
|
||
### **7️⃣ TEST IN PLAY MODE**
|
||
|
||
**Quick Test**:
|
||
1. ▶️ Play
|
||
2. Selection UI appears
|
||
3. Click airplane → Confirm
|
||
4. Airplane spawns at slingshot
|
||
5. Launch and use ability
|
||
6. Button shows cooldown
|
||
|
||
✅ **If all works, you're done!**
|
||
|
||
---
|
||
|
||
## 🎨 UI LAYOUT TIPS
|
||
|
||
### Selection Panel Position:
|
||
- Center screen
|
||
- Width: 80% of screen
|
||
- Background: Semi-transparent dark
|
||
- Buttons: Horizontal layout, equal spacing
|
||
|
||
### Ability Button Position:
|
||
- Bottom-right corner
|
||
- Size: 80x80 pixels
|
||
- Margin: 20px from edges
|
||
- Z-order: On top of everything
|
||
|
||
---
|
||
|
||
## ⚡ FAST TESTING
|
||
|
||
### Test Jet (Hold):
|
||
1. Launch airplane
|
||
2. **Click and hold** ability button
|
||
3. Airplane flies straight
|
||
4. **Release** → Stops
|
||
|
||
### Test Bobbing (Tap):
|
||
1. Launch airplane
|
||
2. **Tap** ability button
|
||
3. Airplane jumps up
|
||
4. Wait for cooldown
|
||
5. Tap again
|
||
|
||
### Test Drop (Tap):
|
||
1. Launch airplane
|
||
2. **Tap** ability button
|
||
3. Airplane drops down
|
||
4. Stops after distance
|
||
|
||
---
|
||
|
||
## 🐛 COMMON ISSUES
|
||
|
||
| Problem | Fix |
|
||
|---------|-----|
|
||
| Selection UI doesn't show | Check it's assigned in GameManager |
|
||
| Button doesn't appear | Check airplane has ability assigned |
|
||
| Hold doesn't work | Check InputManager exists in scene |
|
||
| Airplane doesn't spawn | Check TypeData has prefab assigned |
|
||
| Cooldown doesn't show | Check Fill image is assigned and Radial 360 |
|
||
|
||
---
|
||
|
||
## 📱 MOBILE TESTING
|
||
|
||
1. Build to device
|
||
2. Test touch hold (Jet ability)
|
||
3. Test tap (Bobbing/Drop)
|
||
4. Verify button size is thumb-friendly
|
||
5. Check cooldown is visible
|
||
|
||
---
|
||
|
||
## ✅ COMPLETE CHECKLIST
|
||
|
||
**Settings:**
|
||
- [ ] Configured all 3 airplane types in settings
|
||
- [ ] Assigned all prefabs and sprites
|
||
- [ ] Set default airplane type
|
||
|
||
**UI:**
|
||
- [ ] Built selection UI panel
|
||
- [ ] Built ability button UI
|
||
- [ ] Assigned button references (NO type assets!)
|
||
- [ ] Assigned GameManager references
|
||
|
||
**Testing:**
|
||
- [ ] Selection UI appears and works
|
||
- [ ] Tested Jet ability (hold)
|
||
- [ ] Tested Bobbing ability (tap)
|
||
- [ ] Tested Drop ability (tap)
|
||
- [ ] All cooldowns work
|
||
- [ ] No console errors
|
||
|
||
**When all checked → Ship it! 🚀**
|
||
|
||
---
|
||
|
||
## 🎉 ADVANTAGES
|
||
|
||
✅ **NO ScriptableObject assets to create!**
|
||
✅ **Everything in one settings file**
|
||
✅ **Faster setup** (3 steps vs 7)
|
||
✅ **Easier to maintain**
|
||
✅ **Collapsible Inspector sections**
|
||
✅ **Runtime ability creation from config**
|
||
|