Counter
This component belongs to the following package:
- com.yahaha.sdk.horrorgame
The Counter component (Component) tracks the number of occurrences of specific events and notifies when a target count is reached. It is ideal for gameplay mechanics that depend on collecting items, completing objectives, or any scenario where counting discrete events triggers further actions.
Properties
Property | Description |
---|---|
Notify Key Value Event | Enables sending notifications whenever the count changes. This must be enabled to trigger events like OnKeyValueReached . Disabled by default to optimize performance if notifications are not needed. |
Key Value | The target number of events to track. When the current count reaches this number, the component triggers the OnKeyValueReached event. |
Events and Actions
Trigger
- OnKeyValueReached
- Description:
- Triggered when the KeyValue reaches the target count.
- Description:
Actions:
- Increase
- Description:
- Increase the Counter’s KeyValue by 1, e.g., from 0 to 1.
- Description:
Related Components
This component is usually used with Event Trigger, which sets conditions and actions in response to an event or trigger.