Resource
Key Features
Manages Player Resources: Tracks, updates, and modifies resource quantities for player-controlled entities.
Supports Multiple Resource Types: Works with
ResourceSO
to define different resources like food, wood, gold, etc.Resource Calculation: Uses
ResourceQuantity
to compute costs and manage transactions efficiently.Automatic or Manual Resource Updates: Can handle real-time updates or allow manual adjustments for turn-based systems.
Integration with Other Modules: Works alongside
ProductionModule
to ensure resource availability for unit production.
Structure
Resource Module β Manages resources, including adding, removing, and checking availability.
ResourceSO β Defines resource types as ScriptableObjects, allowing flexible creation of new resources.
ResourceQuantity β Represents specific amounts of resources and handles cost calculations.
Resource Events β Provides global events for UI updates and resource-related triggers.
Usage Examples
Adding Resources Manually
Checking Resource Availability
Deducting Resources for Production
Last updated