57 lines
2.6 KiB
Text
57 lines
2.6 KiB
Text
[gd_scene format=3 uid="uid://c5dgt5hbvpixi"]
|
|
|
|
[ext_resource type="PackedScene" uid="uid://bl1ovsqhcdrql" path="res://assets/models/props/fragments/cop_bot_spawner_fragments.blend" id="1_8c1i5"]
|
|
[ext_resource type="PackedScene" uid="uid://tdwettjsx1o2" path="res://objects/effects/impact_flash_green_large.tscn" id="2_6sva8"]
|
|
[ext_resource type="Material" uid="uid://7d4c1oui1np3" path="res://assets/effects/particle_materials/explosion_dithered.tres" id="3_5rf5a"]
|
|
[ext_resource type="PackedScene" uid="uid://cbdm6154y7m5k" path="res://objects/effects/dustcloud.tscn" id="4_u05xv"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_8c1i5"]
|
|
resource_name = "EnemySpawnerFragments"
|
|
script/source = "extends Node3D
|
|
|
|
var count : int = 0
|
|
var linear_velocity_force : float = 7
|
|
|
|
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:
|
|
var velocity_direction : Vector3 = Vector3(1, 0 ,0).rotated(Vector3.UP, randf_range(0, PI*2)).normalized()
|
|
child.linear_velocity = ((child.global_position - global_position).normalized() + velocity_direction) * linear_velocity_force
|
|
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_xdfb3"]
|
|
material = ExtResource("3_5rf5a")
|
|
center_offset = Vector3(0, 0, -0.1)
|
|
|
|
[sub_resource type="BoxShape3D" id="BoxShape3D_6sva8"]
|
|
size = Vector3(2.0517578, 2.6210938, 1.6542358)
|
|
|
|
[node name="EnemySpawnerDestroyed" type="Node3D" unique_id=1005791497]
|
|
|
|
[node name="cop_bot_spawner_fragments" parent="." unique_id=1700542593 instance=ExtResource("1_8c1i5")]
|
|
script = SubResource("GDScript_8c1i5")
|
|
|
|
[node name="ImpactFlash2" parent="." unique_id=297038791 instance=ExtResource("2_6sva8")]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00251311, 1.3993723, -2.096911)
|
|
draw_pass_1 = SubResource("QuadMesh_xdfb3")
|
|
|
|
[node name="DustCloud" parent="." unique_id=563462513 instance=ExtResource("4_u05xv")]
|
|
transform = Transform3D(1, 0, 0, 0, 0.26053828, 0.9654635, 0, -0.9654635, 0.26053828, -0.102187, 1.2108307, -1.7066432)
|
|
|
|
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1876701336]
|
|
collision_layer = 8
|
|
|
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" unique_id=927553747]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2949219, -0.7823181)
|
|
shape = SubResource("BoxShape3D_6sva8")
|