feat: destructable gates
This commit is contained in:
parent
d8a511c343
commit
699fabfb4d
3 changed files with 167 additions and 137 deletions
|
|
@ -3,10 +3,40 @@
|
|||
[ext_resource type="PackedScene" uid="uid://gc35fkfro7dh" path="res://assets/models/environment/rolling_gate_left_2x3.blend" id="1_uux8f"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbesj25mhw7ld" path="res://assets/models/environment/rolling_gate_right_2x3.blend" id="2_oww5e"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_uux8f"]
|
||||
size = Vector3(3.3867188, 2.9104004, 0.63842773)
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_uux8f"]
|
||||
resource_name = "DestructableGates"
|
||||
script/source = "extends Interactable
|
||||
|
||||
func _highlight_changed(_interactor: PlayerInteractor, value: bool) -> void:
|
||||
var hud := HeadsUpDisplay.get_singleton()
|
||||
if hud:
|
||||
hud.set_tooltip(\"Destroy gate (1 demolition kit)\" if value else \"\")
|
||||
|
||||
func _activated(interactor: PlayerInteractor) -> void:
|
||||
if interactor.try_use_demo_pack():
|
||||
get_owner().queue_free()
|
||||
"
|
||||
|
||||
[node name="DestructableGates" type="Node3D" unique_id=529867088]
|
||||
|
||||
[node name="rolling_gate_left_2x3" parent="." unique_id=1850654445 instance=ExtResource("1_uux8f")]
|
||||
[node name="rolling_gate_left_2x3" parent="." unique_id=386032696 instance=ExtResource("1_uux8f")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 0)
|
||||
|
||||
[node name="rolling_gate_right_2x3" parent="." unique_id=590090466 instance=ExtResource("2_oww5e")]
|
||||
[node name="rolling_gate_right_2x3" parent="." unique_id=588590345 instance=ExtResource("2_oww5e")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0)
|
||||
|
||||
[node name="InteractionArea" type="Area3D" parent="." unique_id=2091182249]
|
||||
collision_layer = 16
|
||||
collision_mask = 0
|
||||
monitoring = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractionArea" unique_id=1577092765]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.974762, -0.14541972)
|
||||
shape = SubResource("BoxShape3D_uux8f")
|
||||
debug_color = Color(0.71673584, 0.25538898, 1, 0.41960785)
|
||||
|
||||
[node name="Interactable" type="Interactable" parent="InteractionArea" unique_id=601910432]
|
||||
script = SubResource("GDScript_uux8f")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue