file-circle-plusHow 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

  1. Import the upgrade icon into Assets/The Archer/Sprites/UI/Upgrades

circle-info

Note that for upgrades we use 564x724 resolution

  1. Set its Texture Type to Sprite (2D and UI).

  2. 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

  1. Open the script: Assets/The Archer/Scripts/Upgrades/UpgradeType.cs

  2. Add a new entry for your upgrade. In an unmodified template, the last index is 8, so use 9:

    Shield = 4,
    Revive = 5,
    AttackSpeed = 6,
    MorePower = 7,
    MoveSpeed = 8,
    HealingIncrease = 9

3. Creating Upgrade Behavior script

  1. Open Assets/The Archer/Scripts/Upgrades/Behaviors folder, create a new script named HealingIncreaseUpgradeBehavior.cs

  2. Add the following code:

4. Creating Upgrade Prefab

  1. Go to: Assets/The Archer/Prefabs/Upgrades

  2. Right-click -> Create -> Prefab Name it Healing Increase Upgrade and open it.

  3. Select the root object and add the HealingIncreaseUpgradeBehavior component.

5. Creating Upgrade Data

  1. Go to: Assets/The Archer/Scriptables/Upgrades

  2. Right-click -> Create -> October -> Upgrades -> Upgrade

  3. 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.

  4. 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