How to add a new Upgrade
This guide explains how to add a new upgrade to the game. As an example, we’ll create an upgrade that increases healing of the Player, called Healing Increase.
1. Importing assets
Import the upgrade icon into
Assets/The Archer/Sprites/UI/Upgrades
Set its Texture Type to Sprite (2D and UI).
If your upgrade behavior requires additional assets such as meshes, textures, or particles, import them into the appropriate subfolders under
Assets/Common.
2. Adding new Upgrade Type
Open the script:
Assets/The Archer/Scripts/Upgrades/UpgradeType.csAdd a new entry for your upgrade. In an unmodified template, the last index is
8, so use9:Shield = 4, Revive = 5, AttackSpeed = 6, MorePower = 7, MoveSpeed = 8, HealingIncrease = 9
3. Creating Upgrade Behavior script
Open
Assets/The Archer/Scripts/Upgrades/Behaviorsfolder, create a new script named HealingIncreaseUpgradeBehavior.csAdd the following code:
4. Creating Upgrade Prefab
Go to:
Assets/The Archer/Prefabs/UpgradesRight-click -> Create -> Prefab Name it Healing Increase Upgrade and open it.
Select the root object and add the HealingIncreaseUpgradeBehavior component.
5. Creating Upgrade Data
Go to:
Assets/The Archer/Scriptables/UpgradesRight-click -> Create -> October -> Upgrades -> Upgrade
Select the newly created asset and fill in its fields according to the Upgrade Data Structure documentation.
Assign the prefab you created in the previous step to the Prefab field.
Add at least one Upgrade Level. Set a value slightly higher then 1.
Finally, open the Upgrades Database asset located in the same folder and add the Healing Increase data asset to the Upgrades List.
6. Testing
Start the game and open Upgrades Page. You should now see the Increase Healing Upgrade at the bottom of the grid.
Last updated