Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. Faction Entity Components
  4. Resource Generator

Resource Generator

The Resource Generator component allows buildings and units to collect resources over time and then add them to the faction. Attach this component to the main object of a unit or a building to turn allow it to produce resources.

  1. Is Active: Is the component active by default?
  2. Resources: Resources to produce every Period (the next field in this component).
  3. Period: Duration (in seconds) required to generate the above resources.
  4. Required Resources: Resources that will be taken from the generator’s faction every Period.
  5. Collection Threshold: Threshold of resources to generate so that the resources are collectable. If a resource type is included in the Resources field but not in this one then it will be assumed that it does not require to reach any threshold before it is collectable.
  6. Auto Collect: Enable this field to automatically add resources to the player’s faction when the collection threshold is met. If disabled, only the player will have to manually select the generator and collect the resources each time using a task on the task panel. As for NPC factions, auto collection is always enabled.
  7. Stop Generating On Threshold Met: Enable this field to stop producing resources when the target collection threshold is met. Disable it to allow the generator to continue producing resources even after the threshold is met.
  8. Collection Audio: What audio clip to play when the player manually collects resources produced by this generator?
  9. Collection Task UI: In case Auto Collection is disabled, the generator allows the player to collect the resources through a task in the task panel. This field allows to define information used to display this resource collection task. For more information about defining a task’s UI elements, please check Entity Component Task UI.
  10. On Threshold Met (Unity Event): Event triggered when the resource generator hits their collection threshold.
  11. On Collected (Unity Event): Event triggered when the resource generator’s generated resources are collected.

How can we help?