Small Godot Wild Jam game
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Convert unit references to consts

+4 -4
+4 -4
Scripts/unit_manager.gd
··· 4 4 @onready var possible_event_nodes: Node2D = %PossibleEventNodes 5 5 @onready var church_nav_point: NavPoint = %ChurchNavPoint 6 6 7 - var doctor_unit = preload("res://Scenes/unit/unit_doctor.tscn") 8 - var priest_unit = preload("res://Scenes/unit/unit_preist.tscn") 7 + const DOCTOR_UNIT = preload("res://Scenes/unit/unit_doctor.tscn") 8 + const PRIEST_UNIT = preload("res://Scenes/unit/unit_preist.tscn") 9 9 10 10 var astar = AStar2D.new() 11 11 ··· 26 26 var unit: Unit 27 27 28 28 if type == Global.UnitType.DOCTOR: 29 - unit = doctor_unit.instantiate() 29 + unit = DOCTOR_UNIT.instantiate() 30 30 else: 31 - unit = priest_unit.instantiate() 31 + unit = PRIEST_UNIT.instantiate() 32 32 33 33 # Spawn at church 34 34 unit.global_position = spawn_point.global_position