49 lines
2.3 KiB
Text
49 lines
2.3 KiB
Text
[gd_scene format=3 uid="uid://bkdtw77ai1qrf"]
|
|
|
|
[ext_resource type="PackedScene" uid="uid://bffa2rkc5vprr" path="res://assets/models/props/fragments/blockade_fragments.blend" id="1_c3uqf"]
|
|
[ext_resource type="PackedScene" uid="uid://tdwettjsx1o2" path="res://objects/effects/impact_flash_green_large.tscn" id="2_yt2un"]
|
|
[ext_resource type="Material" uid="uid://7d4c1oui1np3" path="res://assets/effects/particle_materials/explosion_dithered.tres" id="3_eaihc"]
|
|
[ext_resource type="PackedScene" uid="uid://cbdm6154y7m5k" path="res://objects/effects/dustcloud.tscn" id="4_ypmdb"]
|
|
[ext_resource type="PackedScene" uid="uid://dn1lu8316stf0" path="res://objects/effects/destroyed_object_audio.tscn" id="5_eaihc"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_c3uqf"]
|
|
resource_name = "ComboGateDestroyed"
|
|
script/source = "extends Node3D
|
|
|
|
var count : int = 0
|
|
|
|
func _ready():
|
|
$\"../ImpactFlash2\".restart()
|
|
await PlayerCamera.get_instance().impact_effect($\"../ImpactFlash2\".process_material.color, 0.1, 0.0, 0.02).timeout
|
|
iter(self)
|
|
$\"../DustCloud\".restart()
|
|
|
|
func iter(node):
|
|
for child in node.get_children():
|
|
if child is RigidBody3D:
|
|
child.linear_velocity = ((child.global_position - global_position).normalized() + Vector3(1, 0 ,0).rotated(Vector3.UP, randf_range(0, PI*2)).normalized()) * 4
|
|
child.angular_velocity = Vector3(randf_range(4, 5), randf_range(4, 5), randf_range(4, 5))
|
|
count += 1
|
|
if count % 3 != 0:
|
|
get_tree().create_timer(5 + (count % 5)).timeout.connect(child.queue_free)
|
|
iter(child)
|
|
"
|
|
|
|
[sub_resource type="QuadMesh" id="QuadMesh_gg6xu"]
|
|
material = ExtResource("3_eaihc")
|
|
center_offset = Vector3(0, 0, -0.1)
|
|
|
|
[node name="ComboGateDestroyed" type="Node3D" unique_id=269300662]
|
|
|
|
[node name="blockade_fragments" parent="." unique_id=860386304 instance=ExtResource("1_c3uqf")]
|
|
script = SubResource("GDScript_c3uqf")
|
|
|
|
[node name="ImpactFlash2" parent="." unique_id=297038791 instance=ExtResource("2_yt2un")]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00251311, 1.3518662, 0)
|
|
draw_pass_1 = SubResource("QuadMesh_gg6xu")
|
|
|
|
[node name="DustCloud" parent="." unique_id=1539004666 instance=ExtResource("4_ypmdb")]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.10218748, 0.76868117, 0.11002493)
|
|
|
|
[node name="DestroyedObjectAudio" parent="." unique_id=1054350173 instance=ExtResource("5_eaihc")]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.3858204, 0)
|