small death animation and toolbox
This commit is contained in:
@@ -16,6 +16,8 @@ public partial class HeadSystem : Node3D
|
||||
public delegate void HitTargetEventHandler();
|
||||
[Signal]
|
||||
public delegate void GotHitEventHandler();
|
||||
[Signal]
|
||||
public delegate void DeathAnimationFinishedEventHandler();
|
||||
|
||||
[Signal]
|
||||
public delegate void StepFootEventHandler();
|
||||
@@ -129,6 +131,15 @@ public partial class HeadSystem : Node3D
|
||||
{
|
||||
_animationTree.Set("parameters/OnHit/request", (int) AnimationNodeOneShot.OneShotRequest.Fire);
|
||||
}
|
||||
public void OnStartDeathAnimation()
|
||||
{
|
||||
_animationTree.Set("parameters/OnDie/request", (int) AnimationNodeOneShot.OneShotRequest.Fire);
|
||||
}
|
||||
|
||||
public void OnDeathAnimationFinished()
|
||||
{
|
||||
EmitSignalDeathAnimationFinished();
|
||||
}
|
||||
|
||||
public void OnHitTarget()
|
||||
{
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
[gd_resource type="AnimationNodeBlendTree" load_steps=11 format=3 uid="uid://c26yvcyyyj811"]
|
||||
[gd_resource type="AnimationNodeBlendTree" load_steps=13 format=3 uid="uid://c26yvcyyyj811"]
|
||||
|
||||
[ext_resource type="AnimationNodeStateMachine" uid="uid://3r5oeg0ho0d4" path="res://systems/head/fp_state_machine.tres" id="1_knaxl"]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_1hkum"]
|
||||
animation = &"die"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_knaxl"]
|
||||
animation = &"idle"
|
||||
|
||||
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_ao3u1"]
|
||||
|
||||
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_1hkum"]
|
||||
|
||||
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_knaxl"]
|
||||
@@ -32,8 +37,8 @@ animation = &"jump_start"
|
||||
animation = &"mantle"
|
||||
|
||||
[resource]
|
||||
graph_offset = Vector2(-223.13931, -84.56735)
|
||||
nodes/output/position = Vector2(1540, 0)
|
||||
graph_offset = Vector2(-290.66962, -123.155754)
|
||||
nodes/output/position = Vector2(1700, -40)
|
||||
nodes/AnimationNodeStateMachine/node = ExtResource("1_knaxl")
|
||||
nodes/AnimationNodeStateMachine/position = Vector2(-560, 180)
|
||||
nodes/Idle/node = SubResource("AnimationNodeAnimation_knaxl")
|
||||
@@ -54,4 +59,8 @@ nodes/OnMantle/node = SubResource("AnimationNodeOneShot_dlkjl")
|
||||
nodes/OnMantle/position = Vector2(900, -60)
|
||||
nodes/mantle/node = SubResource("AnimationNodeAnimation_lwjon")
|
||||
nodes/mantle/position = Vector2(640, 320)
|
||||
node_connections = [&"output", 0, &"OnHit", &"OnHit", 0, &"OnMantle", &"OnHit", 1, &"hit1", &"OnJumpStart", 0, &"Idle", &"OnJumpStart", 1, &"jump_start", &"OnJumpEnd", 0, &"OnJumpStart", &"OnJumpEnd", 1, &"jump_end", &"OnMantle", 0, &"OnJumpEnd", &"OnMantle", 1, &"mantle"]
|
||||
nodes/OnDie/node = SubResource("AnimationNodeOneShot_ao3u1")
|
||||
nodes/OnDie/position = Vector2(1500, -60)
|
||||
nodes/Die/node = SubResource("AnimationNodeAnimation_1hkum")
|
||||
nodes/Die/position = Vector2(1280, 340)
|
||||
node_connections = [&"output", 0, &"OnDie", &"OnHit", 0, &"OnMantle", &"OnHit", 1, &"hit1", &"OnJumpStart", 0, &"Idle", &"OnJumpStart", 1, &"jump_start", &"OnJumpEnd", 0, &"OnJumpStart", &"OnJumpEnd", 1, &"jump_end", &"OnMantle", 0, &"OnJumpEnd", &"OnMantle", 1, &"mantle", &"OnDie", 0, &"OnHit", &"OnDie", 1, &"Die"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=29 format=3 uid="uid://0ysqmqphq6mq"]
|
||||
[gd_scene load_steps=30 format=3 uid="uid://0ysqmqphq6mq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dtkdrnsmlwm67" path="res://systems/head/HeadSystem.cs" id="1_8abgy"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://ckr26s4e3fj1m" path="res://assets/swords/resources/fp_sword23.tres" id="2_c5qep"]
|
||||
@@ -133,6 +133,30 @@ tracks/4/keys = {
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0)]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("../../FPRig:position")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0)]
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("../../FPRig:rotation")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_r0h40"]
|
||||
resource_name = "hit1"
|
||||
@@ -305,9 +329,76 @@ tracks/0/keys = {
|
||||
"values": [Vector3(0, 0, 0.00011616433), Vector3(-0.5235988, 0, 0), Vector3(0, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_sdjj3"]
|
||||
resource_name = "die"
|
||||
length = 1.0000033
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("..:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.7),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(4.792308e-05, -0.4125456, 0.56061167)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("..:rotation")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3, 0.7),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0.00011616433), Vector3(0, 0, 0), Vector3(-0.12217305, -0.090757124, 1.727876)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("../../FPRig:position")
|
||||
tracks/2/interp = 2
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.33333334, 0.8333333),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(-0.426, 10, 0.028), Vector3(-1.2110655, 0.36514676, 0.080477595)]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("../../FPRig:rotation")
|
||||
tracks/3/interp = 2
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0, 0.33333334, 0.8333333),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(0.39806452, 0.17761895, 1.4115733), Vector3(-0.5466285, -1.1119838, -2.9170606)]
|
||||
}
|
||||
tracks/4/type = "method"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("../..")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"times": PackedFloat32Array(1),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"OnDeathAnimationFinished"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_0hyrq"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_urko7"),
|
||||
&"die": SubResource("Animation_sdjj3"),
|
||||
&"hit1": SubResource("Animation_r0h40"),
|
||||
&"idle": SubResource("Animation_0hyrq"),
|
||||
&"jump_end": SubResource("Animation_1ay6d"),
|
||||
@@ -322,6 +413,7 @@ DisplacedWeaponSway = 1.0
|
||||
DisplacedWeaponAdjustmentSpeed = 8.0
|
||||
|
||||
[node name="FPRig" type="Node3D" parent="."]
|
||||
transform = Transform3D(0.9999998, 0, 0, 0, 1.0000002, 0, 0, 0, 1.0000002, 0, 0, 0)
|
||||
|
||||
[node name="Sword" type="Node3D" parent="FPRig"]
|
||||
transform = Transform3D(0.42791694, -0.008550272, -0.9037781, 0.19667713, 0.9768738, 0.0838801, 0.88215953, -0.2136461, 0.41970265, 0.53640664, -0.7880347, -1.9288678)
|
||||
@@ -332,7 +424,7 @@ cast_shadow = 0
|
||||
mesh = ExtResource("2_c5qep")
|
||||
|
||||
[node name="CameraSmooth" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, -0.00011616431, 0, 0.00011616433, 0.9999998, 0, 0, 0, 0.9999998, 0, 0, 0)
|
||||
transform = Transform3D(0.99999994, -0.0001161643, 0, 0.00011616432, 0.99999976, 0, 0, 0, 0.9999998, 0, 0, 0)
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="CameraSmooth"]
|
||||
transform = Transform3D(1, -7.508787e-09, -1.4551914e-08, 7.508788e-09, 0.99999994, -1.5046679e-08, 1.4551915e-08, 1.5046679e-08, 0.99999994, -0.04610423, -0.02960227, -0.053528003)
|
||||
@@ -382,6 +474,9 @@ parameters/OnJumpEnd/request = 0
|
||||
parameters/OnMantle/active = false
|
||||
parameters/OnMantle/internal_active = false
|
||||
parameters/OnMantle/request = 0
|
||||
parameters/OnDie/active = false
|
||||
parameters/OnDie/internal_active = false
|
||||
parameters/OnDie/request = 0
|
||||
|
||||
[connection signal="GotHit" from="." to="CameraSmooth/Camera3D/OnGetHitShaker" method="play_shake"]
|
||||
[connection signal="HitTarget" from="." to="CameraSmooth/Camera3D/OnHitShaker" method="play_shake"]
|
||||
|
||||
Reference in New Issue
Block a user