Item Creation Guide
This guide explains how to create Weapons and Armor assets using the Unity Editor.
Quick Start
Creating a Weapon
- In the Project window, navigate to (or create)
Assets/Resources/Items/Weapons/
- Right-click in the folder → Create > Weapon
- Name your weapon (e.g.,
IronSword.asset)
- Select the created asset and edit in the Inspector:
- Item Name: Display name (e.g., "Iron Sword")
- Description: Flavor text
- Icon: Drag a sprite for UI display
- Rarity: 1=Common, 2=Uncommon, 3=Rare, 4=Epic, 5=Legendary
- Attack Bonus: Base attack increase (e.g., 5.0)
- Magic Bonus: Spell power boost (e.g., 0.0)
- Defense Bonus: Parry/block bonus (e.g., 1.0)
- Speed Bonus: Movement modifier (e.g., 0.0)
Creating Armor
- In the Project window, navigate to
Assets/Resources/Items/Armor/
- Right-click → Create > Armor
- Name your armor (e.g.,
LeatherArmor.asset)
- Edit in the Inspector:
- Item Name: Display name
- Description: Flavor text
- Icon: Sprite for UI
- Rarity: Quality tier
- Defense Bonus: Protection increase (e.g., 5.0)
- Health Bonus: Extra durability (e.g., 0.0)
- Speed Penalty: Movement reduction for heavy armor (e.g., 2.0)
- Magic Resistance: Spell damage reduction (e.g., 0.0)
Loading Items at Runtime
Once created in Resources/Items/, load them programmatically:
// Load all weapons
Weapon[] weapons = Resources.LoadAll<Weapon>("Items/Weapons/");
// Load all armor
Armor[] armors = Resources.LoadAll<Armor>("Items/Armor/");
// Load a specific item
Weapon sword = Resources.Load<Weapon>("Items/Weapons/IronSword");
Example Presets
Common Weapon Presets
Iron Sword (Common)
- Attack Bonus: 5.0
- Defense Bonus: 1.0
Steel Greatsword (Uncommon)
- Attack Bonus: 8.0
- Speed Bonus: -0.5
Mage Staff (Rare)
- Attack Bonus: 2.0
- Magic Bonus: 6.0
Common Armor Presets
Leather Armor (Common)
- Defense Bonus: 3.0
- Speed Penalty: 0.0
Steel Plate (Uncommon)
- Defense Bonus: 8.0
- Speed Penalty: 1.0
- Health Bonus: 2.0
Mithril Robes (Rare)
- Defense Bonus: 4.0
- Magic Resistance: 3.0
Behind the Scenes
The ItemCreationMenu editor script (in Combat/Editor/) provides the Create > Weapon and Create > Armor menu items. When you use the menu:
- A save dialog appears
- The asset is created as a ScriptableObject
- It's automatically saved to the Resources folder
- The asset is pinged in the Project window for easy access
Resources folder structure:
Assets/
└── Resources/
└── Items/
├── Weapons/ (auto-created)
│ ├── IronSword.asset
│ └── ...
└── Armor/ (auto-created)
├── LeatherArmor.asset
└── ...
Integration with Agents
See COPY_PASTE_EXAMPLES.cs Example 3 for how to equip agents with weapons and armor at spawn time.