UGTK cat mascotUGTKengine within an engine Request access

UGTK / Toolkit / Component Module / Resource Component Completed

Component Module — UGTK

Resource Component

Summary

The Resource Component provides a flexible system for managing gameplay resources such as health, mana, stamina, currencies, or any other custom values. It allows for precise control over resource behavior, supporting runtime updates, limits, and integrations with other gameplay systems.


Content


Modules Dependencies

The Resource Component module requires the following dependencies:

Ensure that these dependencies are correctly imported and configured in your project.


Setup

To set up the Resource Component, follow these steps:

Resource Component Setup

Add the script Mn_ResourceComponent as component to your object of choice:

  1. Alternatively, use the ResourceText prefab (with TextUpdater) by dragging it in your canvans in the hierarchy:


How To Use

Parameters avaible in the inspector:

Public methods that are avaible to use:


Testing Scene

Open ResourceComponentScene in the module's Debug/ folder.

What to do, in order:

Select Canvas > ResourceText > ResourceComponent and use the Editor Test Tools block, with the editor stopped:

  1. Press Increase() and Decrease() and watch the bar and the x / y readout move.
  2. Press Fill to maximum, then Drop to minimum: the two threshold events fire with one click each.
  3. Set Max Resource to 0 so it is no longer above Min Resource, and try again.

Step 2 exists because the two threshold events are the ones nobody reaches on purpose during normal play, and they are exactly the ones a death screen or a full-ammo sound hangs off. Step 3 shows the configuration the component cannot make sense of - the bar has no travel and the two events fire unpredictably - and the inspector says so instead of leaving you to guess.


Technical Info

The following are the main scripts and workflow of the Rotation Component. Refer to the UML section for the detailed structure.

Scripts:


© 2026 Marcello De Bonis. All rights reserved

Real dependenciesOpen in the map →

Depends on 1

Used by 0

  • No other module depends on it.

Measured from the repository: code references (asmdef) plus prefab and asset GUIDs. Importing this module alone brings in 2 modules in total.