File size: 624 Bytes
8921443
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
extends Node3D


# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var goals = null

# Called when the node enters the scene tree for the first time.
func _ready():
	goals = $Goals.get_children()
	pass # Replace with function body.

func get_next_goal(current_goal):
	if current_goal == null:
		return goals[0]
	var index = null
	for i in len(goals):
		if goals[i] == current_goal:
			index = (i+1) % len(goals)
			break
			
	return goals[index]

func get_last_goal():
	return goals[-1]
			


# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#    pass