Added option to play pickup animation for non-inventory items

This commit is contained in:
2025-08-17 23:13:39 +02:00
parent 5992c390ee
commit 4734ae953c
5 changed files with 19 additions and 2 deletions
+4 -1
View File
@@ -1,7 +1,8 @@
[gd_scene load_steps=15 format=3 uid="uid://sbf12hin4kes"]
[gd_scene load_steps=16 format=3 uid="uid://sbf12hin4kes"]
[ext_resource type="Texture2D" uid="uid://bylgmr0skwtrs" path="res://art/farm/farming/farmobjekte/broken tools atlas.png" id="1_k4ca3"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="2_gcgfd"]
[ext_resource type="Script" uid="uid://dkk1vjijvgrd7" path="res://scripts/CSharp/Common/Items/NonInventoryPickup.cs" id="2_ic616"]
[ext_resource type="AudioStream" uid="uid://be6g8b3v3u1ai" path="res://audio/sfx/Kitchen/SFX_Cooking_Knife_PickUp_01.wav" id="3_ktmp7"]
[ext_resource type="AudioStream" uid="uid://cgjsajsdrrn0j" path="res://audio/sfx/Kitchen/SFX_Cooking_Knife_PutDown_01.wav" id="4_ic616"]
[ext_resource type="AudioStream" uid="uid://br4drgupled6c" path="res://audio/sfx/Kitchen/SFX_Cooking_Pot_01.wav" id="5_dx175"]
@@ -34,6 +35,7 @@ texture = ExtResource("1_k4ca3")
offset = Vector2(1, -215)
region_enabled = true
region_rect = Rect2(44, 479, 356, 503)
script = ExtResource("2_ic616")
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("2_gcgfd")]
position = Vector2(0, -172)
@@ -46,4 +48,5 @@ playback_type = 2
script = ExtResource("13_wswkg")
[connection signal="Interacted" from="InteractionArea" to="." method="queue_free"]
[connection signal="Interacted" from="InteractionArea" to="." method="PlayPickupAnimation"]
[connection signal="Interacted" from="InteractionArea" to="AudioStreamPlayer2D" method="PlayOneShot"]
+1 -1
View File
@@ -2091,7 +2091,7 @@ position = Vector2(-24, -13)
shape = SubResource("CircleShape2D_ssqtd")
debug_color = Color(0.923708, 0.202722, 0.475262, 0.42)
[node name="visuals" type="Node2D" parent="CharacterBody2D" node_paths=PackedStringArray("_sprite", "_wateringParticles") groups=["PlantGrowing"]]
[node name="visuals" type="Node2D" parent="CharacterBody2D" node_paths=PackedStringArray("_sprite", "_wateringParticles") groups=["Pickup", "PlantGrowing"]]
position = Vector2(0, -374)
script = ExtResource("3_f6xmn")
_sprite = NodePath("Animated Sprites")