121 lines
3.5 KiB
Markdown
121 lines
3.5 KiB
Markdown
# Tower Quickslot Setup Guide
|
|
|
|
## 🎯 ULTRA-SIMPLE 1-CLICK SETUP (For Non-Programmers!)
|
|
|
|
### Just ONE Step!
|
|
|
|
Edit your `GameData/Tower.csv` file with tower data, then in Unity:
|
|
|
|
```
|
|
Tools > Data > Import All CSV
|
|
```
|
|
|
|
**THAT'S IT!** This automatically does everything:
|
|
- ✅ Creates TowerData from CSV (TowerData now extends BuildingData!)
|
|
- ✅ Creates Tower prefabs with TowerDataComponent
|
|
- ✅ **Auto-configures BuildingManager with all TowerData!**
|
|
|
|
### Testing
|
|
Press **B** in-game → All towers appear in quickslot! 🎉
|
|
|
|
---
|
|
|
|
## 📝 Adding New Towers
|
|
|
|
1. Add row to `GameData/Tower.csv`
|
|
2. Run `Tools > Data > Import All CSV`
|
|
3. Done! 🚀
|
|
|
|
Everything is automatic!
|
|
|
|
---
|
|
|
|
## 🔧 Troubleshooting
|
|
|
|
### Error: "BuildingManager not found in scene"
|
|
|
|
**Cause:** Your scene doesn't have a GameObject with BuildingManager component.
|
|
|
|
**Fix:**
|
|
1. Create a new GameObject (e.g., "BuildingManager")
|
|
2. Add BuildingManager component to it
|
|
3. Run `Tools > Data > Import All CSV` again
|
|
4. Done!
|
|
|
|
### Error: "MissingReferenceException: prefab doesn't exist"
|
|
|
|
**Cause:** TowerData doesn't have prefab reference.
|
|
|
|
**Fix:**
|
|
1. Run `Northbound > Diagnose Tower System`
|
|
2. Check which TowerData shows `✗ MISSING PREFAB`
|
|
3. Run `Tools > Data > Import All CSV` to fix
|
|
4. Done!
|
|
|
|
### No towers appear in quickslot
|
|
|
|
**Cause:** BuildingManager wasn't found or configured.
|
|
|
|
**Fix:**
|
|
1. Run `Northbound > Diagnose Tower System`
|
|
2. Check if BuildingManager is found and has TowerData in list
|
|
3. If not, add BuildingManager to your scene
|
|
4. Run `Tools > Data > Import All CSV`
|
|
|
|
---
|
|
|
|
## 🎮 Menu Commands
|
|
|
|
| Command | What it does | When to use |
|
|
|---------|--------------|--------------|
|
|
| `Tools > Data > Import All CSV` | **ONE-CLICK SETUP** - Import all CSV files, create prefabs, auto-configure BuildingManager with TowerData | After editing Tower.csv or anytime you want to update towers |
|
|
| `Northbound > Diagnose Tower System` | Check tower system health and find issues | When something doesn't work |
|
|
|
|
---
|
|
|
|
## ✅ Why This is Awesome
|
|
|
|
- ✅ **ONE CLICK** - Edit CSV, run importer, done!
|
|
- ✅ **One folder for towers** - `Assets/Prefabs/Tower/` only
|
|
- ✅ **No duplicates** - No manual copying anywhere
|
|
- ✅ **Fully automatic** - BuildingManager configured automatically
|
|
- ✅ **Non-programmer friendly** - Just edit CSV and click one button!
|
|
- ✅ **Works in builds** - Everything is pre-populated
|
|
- ✅ **Instant testing** - Press B and see all towers!
|
|
- ✅ **Unified data structure** - TowerData extends BuildingData, no redundant data!
|
|
|
|
---
|
|
|
|
## 🎉 Complete Workflow for New Teammates
|
|
|
|
1. Open Unity project
|
|
2. Add BuildingManager GameObject to scene (once)
|
|
3. Edit `GameData/Tower.csv` with tower data
|
|
4. Run `Tools > Data > Import All CSV`
|
|
5. Play game, press **B**, build towers! 🏗️
|
|
|
|
**That's literally it! No manual configuration needed!**
|
|
|
|
---
|
|
|
|
## 🏗️ Technical Details
|
|
|
|
### Unified Data Structure
|
|
|
|
**Before:** Two separate data systems
|
|
- TowerData (CSV, tower-specific stats)
|
|
- BuildingData (auto-generated, building stats)
|
|
|
|
**Now:** Single unified system
|
|
- TowerData extends BuildingData
|
|
- TowerData has all tower-specific fields (atkRange, atkDamage, etc.)
|
|
- TowerData automatically maps to BuildingData fields (width, length, maxHealth, etc.)
|
|
- BuildingManager uses TowerData directly (no conversion needed!)
|
|
|
|
### Benefits of Unified Structure
|
|
- ✅ No duplicate data
|
|
- ✅ Single source of truth
|
|
- ✅ Cleaner code
|
|
- ✅ Easier to maintain
|
|
- ✅ Tower prefabs can be used directly without intermediate BuildingData files
|