Added option to play pickup animation for non-inventory items

feature/showcase_bugfixing_kathi_partII_quickfix
kziolkowski 5 months ago
parent 5992c390ee
commit 4734ae953c

@ -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="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="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://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://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"] [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) offset = Vector2(1, -215)
region_enabled = true region_enabled = true
region_rect = Rect2(44, 479, 356, 503) region_rect = Rect2(44, 479, 356, 503)
script = ExtResource("2_ic616")
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("2_gcgfd")] [node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("2_gcgfd")]
position = Vector2(0, -172) position = Vector2(0, -172)
@ -46,4 +48,5 @@ playback_type = 2
script = ExtResource("13_wswkg") script = ExtResource("13_wswkg")
[connection signal="Interacted" from="InteractionArea" to="." method="queue_free"] [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"] [connection signal="Interacted" from="InteractionArea" to="AudioStreamPlayer2D" method="PlayOneShot"]

@ -2091,7 +2091,7 @@ position = Vector2(-24, -13)
shape = SubResource("CircleShape2D_ssqtd") shape = SubResource("CircleShape2D_ssqtd")
debug_color = Color(0.923708, 0.202722, 0.475262, 0.42) 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) position = Vector2(0, -374)
script = ExtResource("3_f6xmn") script = ExtResource("3_f6xmn")
_sprite = NodePath("Animated Sprites") _sprite = NodePath("Animated Sprites")

@ -207,6 +207,7 @@ folder_colors={
[global_group] [global_group]
PlantGrowing="" PlantGrowing=""
Pickup=""
[input] [input]

@ -0,0 +1,12 @@
using Babushka.scripts.CSharp.Common.Animation;
using Godot;
namespace Babushka.scripts.CSharp.Common.Items;
public partial class NonInventoryPickup : Node2D
{
public void PlayPickupAnimation()
{
GetTree().CallGroup("Pickup", VesnaAnimations.MethodName.PlayPickUpAnimation);
}
}
Loading…
Cancel
Save