Plants animation now supports timescale

This commit is contained in:
Rendo 2025-07-07 23:14:32 +05:00
commit e7a9860a54
18 changed files with 141 additions and 60 deletions

View file

@ -1,10 +1,12 @@
[gd_scene load_steps=10 format=3 uid="uid://bq7imkpr2yqyr"]
[gd_scene load_steps=12 format=3 uid="uid://bq7imkpr2yqyr"]
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_fluxn"]
[ext_resource type="Texture2D" uid="uid://dstqh1wc5dvmo" path="res://assets/sprites/atlases/plants/wallnut.png" id="2_o5tda"]
[ext_resource type="AnimationLibrary" uid="uid://0bdesb8j2mbo" path="res://resources/animations/plants/wallnut.res" id="3_xl65q"]
[ext_resource type="Script" uid="uid://btkmd86pn828y" path="res://scripts/components/plants/behaviours/HpBasedBehaviour.cs" id="4_cjtyy"]
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_y3tlf"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ds5ry"]
animation = &"wallnut/idle_full"
@ -24,18 +26,24 @@ blend_point_2/pos = 0.3
min_space = 0.0
blend_mode = 1
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_bi7an"]
graph_offset = Vector2(-498, 95)
nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_y3tlf")
nodes/TimeScale/position = Vector2(60, 140)
nodes/Tree/node = SubResource("AnimationNodeBlendSpace1D_nij8v")
nodes/Tree/position = Vector2(-180, 180)
node_connections = [&"TimeScale", 0, &"Tree", &"output", 0, &"TimeScale"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_khltr"]
size = Vector2(33, 46)
[node name="Wallnut" instance=ExtResource("1_fluxn")]
MaxHP = 600.0
_effectImmunities = Array[Resource]([])
[node name="Sprite2D" parent="." index="0"]
texture = ExtResource("2_o5tda")
hframes = 12
vframes = 3
frame = 3
[node name="AnimationPlayer" parent="." index="1"]
libraries = {
@ -43,8 +51,9 @@ libraries = {
}
[node name="AnimationTree" parent="." index="2"]
tree_root = SubResource("AnimationNodeBlendSpace1D_nij8v")
parameters/blend_position = 1.0
tree_root = SubResource("AnimationNodeBlendTree_bi7an")
parameters/TimeScale/scale = 1.0
parameters/Tree/blend_position = 1.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"]
position = Vector2(3.5, 5)