-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #328 - Make the RandomizedComposite node know when to remove we…
…ights when children exit (#329) * Added test for issue #328 * Update randomized_composite.gd Updated the node to keep track of whether the parent and children are all exiting and only remove the child weight if the parent is staying in the tree. * Apply suggestions from code review Co-authored-by: miguel <[email protected]> --------- Co-authored-by: miguel <[email protected]>
- Loading branch information
Showing
3 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
test/randomized_composites/runtime_changes/RuntimeChangesTestScene.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
extends Node2D | ||
|
||
@onready var sequence_random: SequenceRandomComposite = %SequenceRandom | ||
|
||
func set_weights(idle: int, run: int, attack_meele: int, attack_ranged: int): | ||
sequence_random.set("Weights/Idle", idle) | ||
sequence_random.set("Weights/Run", run) | ||
sequence_random.set("Weights/Attack Meele", attack_meele) | ||
sequence_random.set("Weights/Attack Ranged", attack_ranged) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters