Skip to content

Commit

Permalink
Rename AeroPropeller3D propeller to propeller_blade.
Browse files Browse the repository at this point in the history
  • Loading branch information
addmix committed Jul 28, 2024
1 parent 366b154 commit f7f24b6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions core/aero_influencer_3d/aero_rotator_3d/aero_propeller_3d.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class_name AeroPropeller3D
propeller_amount = x
update_propeller_amount()
##Propeller blade that will be duplicated and arranged. See `do_propeller_setup`
@export var propeller : AeroInfluencer3D:
@export var propeller_blade : AeroInfluencer3D:
set(x):
update_configuration_warnings()
if propeller == x:
if propeller_blade == x:
return

propeller = x
propeller_blade = x

if Engine.is_editor_hint():
return
Expand All @@ -31,7 +31,7 @@ class_name AeroPropeller3D
instance.queue_free()

#reinitialize instances array
propeller_instances = [propeller]
propeller_instances = [propeller_blade]
update_propeller_amount()
var propeller_instances : Array[AeroInfluencer3D] = []

Expand All @@ -44,7 +44,7 @@ func _ready():

func _get_configuration_warnings() -> PackedStringArray:
var arr : PackedStringArray = super._get_configuration_warnings()
if not propeller:
if not propeller_blade:
arr.append("Propeller has not been assigned, or is not a valid instance. Make sure you have assigned an AeroInfluencer3D as a propeller.")

return arr
Expand All @@ -57,7 +57,7 @@ func update_propeller_amount() -> void:
return
if Engine.is_editor_hint() or not is_node_ready():
return
if not propeller:
if not propeller_blade:
push_warning("No propeller defined. Aborting...")

var change_in_amount : int = propeller_amount - propeller_instances.size()
Expand All @@ -69,7 +69,7 @@ func update_propeller_amount() -> void:
#instance new propellers
elif change_in_amount > 0:
for i : int in change_in_amount:
var new_prop : AeroInfluencer3D = propeller.duplicate()
var new_prop : AeroInfluencer3D = propeller_blade.duplicate()
add_child(new_prop)
propeller_instances.append(new_prop)

Expand All @@ -81,7 +81,7 @@ func update_propeller_amount() -> void:
update_propeller_transforms()

func update_propeller_transforms() -> void:
var base_transform : Transform3D = propeller.default_transform
var base_transform : Transform3D = propeller_blade.default_transform

for i in propeller_amount - 1:
var prop_index = i + 1 #we already have 1 surface, so we add 1
Expand Down

0 comments on commit f7f24b6

Please sign in to comment.