ASStateSnapshot
Inherits:
ResourceResource that captures and restores the state of an ASComponent.
Description
ASStateSnapshot is a high-level data container used for networking (replication, rollback) and gameplay persistence (save systems). It encapsulates all attribute base values, active tags, and the state of active effects (remaining time, stacks) of an [ASComponent] at an exact point in time (tick).
Properties
| Type | Name | Default |
|---|---|---|
Array | active_effects | [] |
Dictionary | attributes | {} |
Dictionary mapping attribute names (StringName) to their base values (float). | ||
PackedStringArray | tags | PackedStringArray() |
List of all active tags at the time of capture. | ||
int | tick | 0 |
The simulation tick number when this snapshot was captured. | ||
Methods
| Return | Name |
|---|---|
void | apply_to_component(
component: ASComponent)
const |
Restores the state stored in this snapshot to the provided [ASComponent]. | |
void | capture_from_component(
component: ASComponent) |
Captures the current state (attributes and tags) from the provided [ASComponent] into this resource. | |