Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. Buildings
  4. Resource Generator

Resource Generator

The Resource Generator component allows buildings to collect resources over time and then add them to the faction. Attach this component to a building to turn it into a resource generator.

  1. Generators: One resource generator can generate multiple types of resources, for each resource type that can be produced add an element to this array field and then define its settings:
    1. Resource Type: Drag and drop the Resource Type Info asset of the resource type that is generated.
    2. Task Icon: The icon to display in the task panel when the player selects the resource generator and attempts to collect the gathered resources. In case the resource can not be automatically collected.
    3. Auto Collect: When enabled, the resources collected here will be automatically added to the faction’s resources. However, when disabled, the player will have to collect this resource manually when it reaches a certain threshold (Max Amount) by selecting the resource generator and clicking on a task in the task panel.
    4. Collect One Unit Time: Time required to collect one unit from this resource.
    5. Max Amount: Only valid if Auto Collect is disabled. When the generator generates this amount of the specified resource type, the resource generation will stop and will only continue when the player collects the resource.
  2. Task Panel Category: Only valid for generators that have Auto Collect disabled. When using categories in the task panel (UI Manager), this is the ID of the task panel that this generators’ resource collection tasks belong to when it appears while selecting the resource generator. Task Panel categories allow to organize tasks based on a criteria that you can choose.
  3. Collection Audio: When the generated resource amount reaches the maximum amount, this audio clip will be played.

How can we help?