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,4 +1,4 @@
[gd_scene load_steps=16 format=3 uid="uid://bg7lomiorxo2c"]
[gd_scene load_steps=18 format=3 uid="uid://bg7lomiorxo2c"]
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_bikjn"]
[ext_resource type="Texture2D" uid="uid://b3tuidu8dag8u" path="res://assets/sprites/atlases/plants/sunflower.png" id="2_fwcda"]
@ -12,7 +12,7 @@ length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimationTree:parameters/conditions/produce")
tracks/0/path = NodePath("AnimationTree:parameters/Tree/conditions/produce")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
@ -27,6 +27,8 @@ _data = {
&"RESET": SubResource("Animation_bfx6v")
}
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_811ah"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_lkpmx"]
animation = &"sunflower/idle"
@ -51,18 +53,24 @@ states/sunflower_produce/node = SubResource("AnimationNodeAnimation_hc6hn")
states/sunflower_produce/position = Vector2(624, 99)
transitions = ["Start", "sunflower_idle", SubResource("AnimationNodeStateMachineTransition_26fia"), "sunflower_idle", "sunflower_produce", SubResource("AnimationNodeStateMachineTransition_d2akw"), "sunflower_produce", "sunflower_idle", SubResource("AnimationNodeStateMachineTransition_sww40")]
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_rlkb7"]
graph_offset = Vector2(-437, 84)
nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_811ah")
nodes/TimeScale/position = Vector2(100, 140)
nodes/Tree/node = SubResource("AnimationNodeStateMachine_enpal")
nodes/Tree/position = Vector2(-160, 180)
node_connections = [&"TimeScale", 0, &"Tree", &"output", 0, &"TimeScale"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4xs4g"]
size = Vector2(26, 48)
[node name="Sunflower" instance=ExtResource("1_bikjn")]
MaxHP = 30.0
_effectImmunities = Array[Resource]([])
[node name="Sprite2D" parent="." index="0"]
texture = ExtResource("2_fwcda")
hframes = 9
vframes = 2
frame = 4
[node name="AnimationPlayer" parent="." index="1"]
libraries = {
@ -71,8 +79,9 @@ libraries = {
}
[node name="AnimationTree" parent="." index="2"]
tree_root = SubResource("AnimationNodeStateMachine_enpal")
parameters/conditions/produce = false
tree_root = SubResource("AnimationNodeBlendTree_rlkb7")
parameters/TimeScale/scale = 1.0
parameters/Tree/conditions/produce = false
[node name="PlantSunSpawner" type="Node2D" parent="." index="3"]
position = Vector2(-2, 0)