mirror of
https://github.com/Steffo99/looping-for-loops.git
synced 2024-11-29 03:24:20 +00:00
13 lines
297 B
GDScript
13 lines
297 B
GDScript
extends Node2D
|
|
class_name GameButtonChain
|
|
|
|
|
|
func _ready():
|
|
var children: Array = get_children()
|
|
for i in len(children):
|
|
if i == 0:
|
|
children[i].set_active(true)
|
|
else:
|
|
children[i].set_active(false)
|
|
if i < len(children) - 1:
|
|
children[i].connect("clicked", children[i+1], "activate")
|