This commit is contained in:
mathias committed 2020-02-01 16:31:55 +01:00
commit c803198bfc
14 files changed
+89 -13

No files matched your search

+15 -9
View File
@@ -87,13 +87,21 @@ func _input(event):
_prev_mouse_pos = event.position
_viewRot = true
else:
print("mouse unpressed at: ", event.position)
_viewRot = false
func body_part_chosen(params):
var limb = _attachment_point.get_node("Limb")
if limb != null:
#no _attachment_point
if _attachment_point != null:
var limb = _attachment_point.get_node("Limb")
#adding only possible if no first child
#if limb.get_child(0) == null:
# limb.add_child(BodyPartLoader.bodyparts[params].instance())
#if spot already taken, DELETE
if limb.get_child(0) != null:
delete_body_part()
limb.add_child(BodyPartLoader.bodyparts[params].instance())
@@ -103,10 +111,8 @@ func make_it_shine(highlight : bool):
func delete_body_part():
var body_part = _attachment_point.get_node("Limb").get_child(0)
if body_part != null:
body_part.queue_free()
if _attachment_point != null:
var body_part = _attachment_point.get_node("Limb").get_child(0)
if body_part != null:
body_part.queue_free()