Create Resource Type
The first step into incorporating resources to your RTS game is to create the actual resource types that you'll be using. A Resource Type is defined by a scriptable object that holds its properties.
In the project tab, right click and choose: Create -> RTS Engine -> Resource Type.
We will start off by creating a wood resource type, therefore we can call the scriptable object something like tutorial_resource_wood. Now select it and let's assign its properties:
- Key: Input a code that is unique among other resource types.
- Display Name: The name that will appear on UI elements when referring to the resource type.
- Description: The descriptive text that would appear on the UI tooltip when the player hovers their mouse over the resource icon.
- Has Capacity / Capacity Type: Capacity resources allow to have a restriction on the resource's amount. The capacity or amount can be both be updated. For the wood resource, we want it to be uncapped. Therefore we will not discuss capacity resources more here until we get to using them later.
- Amount: The starting amount that each faction receives from the resource. For example, 200. Since this is not a capacity resource then we can leave the Capacity field empty.
- Icon: The sprite that will be used to refer to the asset in UI elements. If you have the demo files still, you can search for the wood_icon sprite.
Download Files
You can download the results of this tutorial here.