4.6 KiB
4.6 KiB
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:
- ▶️ Play
- Selection UI appears
- Click airplane → Confirm
- Airplane spawns at slingshot
- Launch and use ability
- 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):
- Launch airplane
- Click and hold ability button
- Airplane flies straight
- Release → Stops
Test Bobbing (Tap):
- Launch airplane
- Tap ability button
- Airplane jumps up
- Wait for cooldown
- Tap again
Test Drop (Tap):
- Launch airplane
- Tap ability button
- Airplane drops down
- 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
- Build to device
- Test touch hold (Jet ability)
- Test tap (Bobbing/Drop)
- Verify button size is thumb-friendly
- 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