The resource’s parent object has the Resource component attached to it. This is the main component that defines a resource. The resource’s parent object must have its layer set to “Resource” as well.
Resource General Settings:
- Name: Input the resource type in this field, this is the same name that is defined in the Resource Manager component.
- Code: Unique for each resource variation (for example, two resources can have different models and look but they allow the unit to collect the same resource type, therefore they must have the same Name but different codes).
- Radius: The radius of the resource on the navigation mesh.
- Amount: The amount that this resource hold.
- Infinite: When enabled, the resource’s amount will be infinite.
- Destroy On Complete: In case the resource amount is not infinite and this is set to true, then the resource object will be destroyed when its amount is null.
Collection & Drop Off Settings:
- Collect Outside Border: When enabled, then units will be able to collect this resource even if it’s outside their faction resources.
- Collect Amount Per Second: The amount that a unit collects from this resource each second.
- Have Drop Off Range: When enabled, then this will require the collector to drop this resource only to drop off buildings that are inside a certain range. You should only consider this option if the resource collection mode is not set to automatic.
- Drop Off Range: the range size for the above option.
- Show Collectors: When enabled, the amount of collectors will be shown in the selection panel when the resource is selected.
- Show Amount: When enabled, the amount of the resource will be shown in the selection panel when the resource is selected.
- Resource Plane: This is the object that holds the selection texture and which will be activated when the resource is selected. Also a child object of the main resource’s object and has “Resource” as its layer.
- Player Selection: The selection collider must not be the same as the resource’s main collider. Therefore, create a new empty object and make it child of the main resource’s object. The selection collider must not be the same as the resource’s frontier collider. It’s a child object of the resource parent object. It includes a Collider component with “Is Trigger” set to true. This collider represents where the player has to click with the mouse in order to select the resource and also acts as hitbox for attack objects. It also has the Selection Obj component attached to it. The selection object is then assigned to the “Resource Selection Component” field in the Resource component, the Selection Obj component has the following fields
- Obj Type: Set to Resource.
- Can Select: Can this resource be selected?
- Select Owner Only: Only applicable for units & buildings.
- Minimap Icon Size: Represents the size of the minimap icon for this resource.