Free dagger when user click
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
extends Spatial
|
||||
signal clicked(dagger)
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
print("[Dagger#_ready]")
|
||||
connect("clicked", self, "handle_piece_click")
|
||||
|
||||
func _on_Area_input_event(camera, event, click_position, click_normal, shape_idx):
|
||||
print("[Dagger#_ready] You have clicked in dagger ...")
|
||||
if event is InputEventMouseButton:
|
||||
print("[Dagger#_ready] Click !! Click !!")
|
||||
$dagger.free()
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://assets/props/dagger/dagger.mesh" type="ArrayMesh" id=1]
|
||||
[ext_resource path="res://assets/props/misc/plane.mesh" type="ArrayMesh" id=2]
|
||||
[ext_resource path="res://developers/jeremy/Dagger.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="CapsuleShape" id=1]
|
||||
radius = 0.136165
|
||||
height = 0.0793334
|
||||
|
||||
[node name="Spatial" type="Spatial"]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
@@ -19,3 +23,10 @@ material/0 = null
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.542265, 0.160108, -0.620212 )
|
||||
mesh = ExtResource( 1 )
|
||||
material/0 = null
|
||||
|
||||
[node name="Area" type="Area" parent="dagger"]
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="dagger/Area"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[connection signal="input_event" from="dagger/Area" to="." method="_on_Area_input_event"]
|
||||
|
||||
Reference in New Issue
Block a user