From 9efb1baa1840797129408bd213cded0f32e7d470 Mon Sep 17 00:00:00 2001 From: unfa Date: Sat, 26 Sep 2020 01:01:43 +0200 Subject: [PATCH] BulletFlyBySoundPlayer scene --- Audio/BulletFlyBySoundPlayer.gd | 20 ++++++++++++++++++++ Audio/BulletFlyBySoundPlayer.tscn | 14 ++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Audio/BulletFlyBySoundPlayer.gd create mode 100644 Audio/BulletFlyBySoundPlayer.tscn diff --git a/Audio/BulletFlyBySoundPlayer.gd b/Audio/BulletFlyBySoundPlayer.gd new file mode 100644 index 0000000..76c8335 --- /dev/null +++ b/Audio/BulletFlyBySoundPlayer.gd @@ -0,0 +1,20 @@ +extends Spatial + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass + + +func _on_AudioStreamPlayer3D_finished(): + queue_free() diff --git a/Audio/BulletFlyBySoundPlayer.tscn b/Audio/BulletFlyBySoundPlayer.tscn new file mode 100644 index 0000000..eafc69c --- /dev/null +++ b/Audio/BulletFlyBySoundPlayer.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://Audio/SoundPlayer.tscn" type="PackedScene" id=1] +[ext_resource path="res://Audio/BulletFlyBySoundPlayer.gd" type="Script" id=2] + +[node name="BulletFlyBySoundPlayer" type="Spatial"] +script = ExtResource( 2 ) + +[node name="SoundPlayer" parent="." instance=ExtResource( 1 )] +SoundClip = "res://Assets/SFX/Weapons-BulletFlyBy-01.wav" +AutoPlay = true +[connection signal="finished" from="SoundPlayer/AudioStreamPlayer3D" to="." method="_on_AudioStreamPlayer3D_finished"] + +[editable path="SoundPlayer"]