Started a Godot Project to remake Tailgunner.
This commit is contained in:
commit
9621323983
67 changed files with 976 additions and 0 deletions
23
scripts/flyer_controller.gd
Normal file
23
scripts/flyer_controller.gd
Normal file
|
@ -0,0 +1,23 @@
|
|||
@tool
|
||||
class_name FlyerController
|
||||
extends Node
|
||||
|
||||
# references
|
||||
@export var controlled_flyer: Flyer:
|
||||
set(new_flyer):
|
||||
controlled_flyer = new_flyer
|
||||
update_configuration_warnings()
|
||||
|
||||
func _ready() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
var parent = get_parent()
|
||||
if (parent is Flyer):
|
||||
controlled_flyer = parent
|
||||
update_configuration_warnings()
|
||||
|
||||
func _get_configuration_warnings():
|
||||
var warnings = []
|
||||
|
||||
if controlled_flyer == null:
|
||||
warnings.append("Please select a flyer to be controlled by this controller.")
|
||||
return warnings
|
Loading…
Add table
Add a link
Reference in a new issue