瀏覽代碼

[IK] Script fixes

Fix warnings, ensure functions are spaced
Aaron Franke 6 年之前
父節點
當前提交
6a1fe3b48a

+ 8 - 3
3d/ik/addons/sade/ik_fabrik.gd

@@ -46,8 +46,8 @@ var first_call = true
 # A boolean to track whether or not we want to print debug messages
 var debug_messages = false
 
+
 func _ready():
-	
 	if (target == null):
 		# NOTE: you HAVE to have a node called target as a child of this node!
 		# so we create one if one doesn't already exist
@@ -210,6 +210,7 @@ func _set_bone_chain_bones(new_value):
 	
 	_make_bone_nodes()
 
+
 func _set_bone_chain_lengths(new_value):
 	bones_in_chain_lengths = new_value
 	total_length = null
@@ -217,14 +218,18 @@ func _set_bone_chain_lengths(new_value):
 
 # Various upate methods
 # ---------------------
-func _process(delta):
+func _process(_delta):
 	if reset_iterations_on_update == true:
 		chain_iterations = 0
 	update_skeleton()
-func _physics_process(delta):
+
+
+func _physics_process(_delta):
 	if reset_iterations_on_update == true:
 		chain_iterations = 0
 	update_skeleton()
+
+
 func _notification(what):
 	if what == NOTIFICATION_TRANSFORM_CHANGED:
 		if reset_iterations_on_update == true:

+ 7 - 2
3d/ik/addons/sade/ik_look_at.gd

@@ -16,6 +16,7 @@ var skeleton_to_use
 var first_call = true
 const empty_vector = Vector3()
 
+
 func _ready():
 	
 	set_process(false)
@@ -195,10 +196,14 @@ func update_skeleton():
 
 # Various upate methods
 # ---------------------
-func _process(delta):
+func _process(_delta):
 	update_skeleton()
-func _physics_process(delta):
+
+
+func _physics_process(_delta):
 	update_skeleton()
+
+
 func _notification(what):
 	if what == NOTIFICATION_TRANSFORM_CHANGED:
 		update_skeleton()

+ 0 - 2
3d/ik/addons/sade/plugin_main.gd

@@ -8,7 +8,6 @@ func _enter_tree():
 	add_custom_type("IK_LookAt", "Spatial", preload("ik_look_at.gd"), preload("ik_look_at.png"))
 	add_custom_type("IK_FABRIK", "Spatial", preload("ik_fabrik.gd"), preload("ik_fabrik.png"))
 	# ------ ---------- ------
-	
 
 
 func _exit_tree():
@@ -18,4 +17,3 @@ func _exit_tree():
 	remove_custom_type("IK_LookAt")
 	remove_custom_type("IK_FABRIK")
 	# ------ ---------- ------
-	

+ 4 - 0
3d/ik/button_change_scene.gd

@@ -2,9 +2,13 @@ extends Button
 
 export (String, FILE) var scene_to_change_to = null
 
+
 func _ready():
+	# warning-ignore:return_value_discarded
 	connect("pressed", self, "change_scene")
 
+
 func change_scene():
 	if scene_to_change_to != null:
+		# warning-ignore:return_value_discarded
 		get_tree().change_scene(scene_to_change_to)

+ 2 - 2
3d/ik/example_player.gd

@@ -175,7 +175,7 @@ func process_input(delta):
 		var lerp_value = (lean_value - 0.5) * 2
 		path_follow_node.rotation_degrees.z = (-20 * lerp_value)
 	# ----------------------------------
-	
+
 
 func process_movement(delta):
 	
@@ -234,7 +234,7 @@ func _input(event):
 		pass
 
 
-func animation_finished(anim):
+func animation_finished(_anim):
 	anim_done = true
 
 

+ 2 - 0
3d/ik/simple_bullet.gd

@@ -3,9 +3,11 @@ extends RigidBody
 const KILL_TIME = 5
 var timer = 0
 
+
 func _ready():
 	set_physics_process(true);
 
+
 func _physics_process(delta):
 	timer += delta
 	if timer > KILL_TIME:

+ 2 - 2
3d/ik/target_from_mousepos.gd

@@ -9,7 +9,8 @@ export (bool) var flip_axis = false
 func _ready():
 	targets = get_node("targets")
 
-func _process(delta):
+
+func _process(_delta):
 	var mouse_to_world = project_local_ray_normal(get_viewport().get_mouse_position()) * MOVEMENT_SPEED
 	
 	if flip_axis == false:
@@ -18,4 +19,3 @@ func _process(delta):
 		mouse_to_world = -mouse_to_world
 	
 	targets.transform.origin = mouse_to_world
-