Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. Resources
  4. Resource Component

Resource Component

The resource’s parent object must have 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.


General Settings:

  1. Resource Type: Drag and drop the Resource Type Info asset that is represented by this resource object in this field.
  2. Radius: The radius of the resource on the navigation mesh. The radius’ value defines the distance at which the units can interact with the resource object when collecting it.
  3. Infinite Amount: When enabled, the resource’s amount will be infinite.
  4. Amount: The amount that this resource hold. In case the Infinite Amount option is disabled.
  5. Destroy On Empty: In case the resource amount is not infinite and this is enabled, then the resource object will be destroyed when its amount hits zero.
  6. Selection Plane: This is the object that holds the selection texture and which will be activated when the resource object is selected. This is a child object of the main resource object includes a Mesh Renderer component as it will be colored in the faction’s color when activated.
  7. Selection: The selection collider can’t be the same as the resource object’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 object. It includes the Resource Selection component attached to it. The selection object is then assigned to the Selection field in the Resource component, the Resource Selection component has the following fields
    1. Can Select: Can this resource be selected?
    2. Select Owner Only: Only valid for unit and building selection components.
    3. Minimap Icon Size: Represents the size of the minimap icon for this resource object.

Collection & Drop Off Settings:

  1. Can Collect Outside Border: When enabled, then units will be able to collect this resource even if it’s outside their faction resources.
  2. Collect One Unit Duration: The time that a resource collector spends gathering this resource in order to collect one unit of it

UI Settings:

  1. Show Collectors: When enabled, the amount of collectors will be shown in the selection panel when the resource is selected.
  2. Show Amount: When enabled, the amount of the resource will be shown in the selection panel when the resource is selected.

 

How can we help?