1
Fork 0
mirror of https://github.com/Steffo99/looping-for-loops.git synced 2024-11-23 00:24:22 +00:00
looping-for-loops/Objects/ScrollingObjects/Buttons/GameButtonChain.gd

14 lines
297 B
GDScript3
Raw Permalink Normal View History

2020-10-04 18:26:45 +00:00
extends Node2D
2020-10-05 20:20:12 +00:00
class_name GameButtonChain
2020-10-04 18:26:45 +00:00
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")