GDScript Signals

by ava

7

GDScript Signals

A Godot 4.x plugin which provides a Signals class which exposes static
functions for interacting with lists of Signals, like Promise.all() in
JavaScript.

View in Godot Asset Library

Usage

After importing and enabling the plugin, use one of the static methods attached
to Signals detailed below.

all(signals_list)->Array

Given a list of
Signals,
waits until all of the signals complete, then returns an array of the results
from the signals, matching the order the signals were passed in.

Example:

var results := await Signals.all([
	weapon.target_was_hit,
	weapon.animation_complete
])

any(signals_list)

Given a list of
Signals,
waits until at least one of those signals completes, returning the result of
that completed signal.

Example:

var result = await Signals.any([
	target.damage_taken,
	bullet.expired
])

Contributing

Feel free to send pull requests or issues. This repository is a complete Godot
4.x project, so it can be imported locally for development.

Note: This repo comes with Gut unit tests,
please make sure to add new test coverage and check existing tests when adding
or changing code.

Version

1.0.2

Engine

4.0

Category

Scripts

Download

Version1.0.2
Download Now

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author