Skip to content

Resource

namespace Griff.Modules.Strategy;
public sealed class Resource : Component

Something workers gather: a gold mine, a tree. Each trip takes a load away; when Amount runs out it’s gone. Give it a sprite and a collider (or a sprite alone) the size it covers; units walk around it.

This is a component: its saved properties are on its component page.

public int Amount { get; set; }

How much is left.

public bool Blocks { get; set; }

Whether units walk around it. Untick it for something they can stand on.

public string? Kind { get; set; }

What it gives, e.g. “Gold” or “Wood”: an item, the same as a pickup’s or an inventory’s (see Items).