Animated switches

This commit is contained in:
MaddoScientisto 2026-03-01 17:17:04 +01:00
commit f7240e1167
6 changed files with 422 additions and 233 deletions

View file

@ -7,9 +7,10 @@
[ext_resource type="PackedScene" uid="uid://w6jg5rx6d5gp" path="res://3D/BlockbenchModels/ControlPad/Control_Pad_Shoot.gltf" id="5_uhypp"]
[ext_resource type="Texture2D" uid="uid://b7i8madir447q" path="res://3D/BlockbenchModels/ControlPad/Control_Pad_Shoot_0.png" id="6_pmslt"]
[ext_resource type="Script" uid="uid://b46e1ft1scvwt" path="res://Scripts/Interactables/FrameAnimator3D.cs" id="6_uok2k"]
[ext_resource type="Script" uid="uid://cklsqt246d571" path="res://Scripts/Interactables/SwitchAnimationManager.cs" id="8_4smss"]
[sub_resource type="SphereShape3D" id="SphereShape3D_itd0i"]
radius = 0.868968
[sub_resource type="BoxShape3D" id="BoxShape3D_4smss"]
size = Vector3(1, 1, 0.32867432)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4smss"]
resource_name = "material_0"
@ -28,14 +29,31 @@ loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatorManager:CurrentFrame")
tracks/0/path = NodePath("FrameAnimator:CurrentFrame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.20016107, 0.40089402, 0.60219884),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"times": PackedFloat32Array(0, 0.4),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [0, 1, 2, 3]
"values": [0, 1]
}
[sub_resource type="Animation" id="Animation_fmo5v"]
resource_name = "Flash"
length = 0.8
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("FrameAnimator:CurrentFrame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.4),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [2, 3]
}
[sub_resource type="Animation" id="Animation_4smss"]
@ -43,7 +61,7 @@ length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatorManager:CurrentFrame")
tracks/0/path = NodePath("FrameAnimator:CurrentFrame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
@ -55,7 +73,8 @@ tracks/0/keys = {
[sub_resource type="AnimationLibrary" id="AnimationLibrary_fmo5v"]
_data = {
&"Flash": SubResource("Animation_pmslt"),
&"Disabled": SubResource("Animation_pmslt"),
&"Enabled": SubResource("Animation_fmo5v"),
&"RESET": SubResource("Animation_4smss")
}
@ -75,7 +94,8 @@ texture = ExtResource("2_uok2k")
hframes = 4
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1191207257]
shape = SubResource("SphereShape3D_itd0i")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.09780884)
shape = SubResource("BoxShape3D_4smss")
[node name="ActivationSound" type="AudioStreamPlayer3D" parent="." unique_id=1198083209]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.15351868)
@ -92,12 +112,18 @@ bus = &"Effects"
[node name="cylinder" parent="blockbench_export2" index="0"]
surface_material_override/0 = SubResource("StandardMaterial3D_4smss")
[node name="AnimatorManager" type="Node3D" parent="." unique_id=1796988427 node_paths=PackedStringArray("TargetMesh")]
[node name="FrameAnimator" type="Node3D" parent="." unique_id=1796988427 node_paths=PackedStringArray("TargetMesh")]
script = ExtResource("6_uok2k")
TargetMesh = NodePath("../blockbench_export2/cylinder")
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=38747516]
libraries/ = SubResource("AnimationLibrary_fmo5v")
autoplay = &"Flash"
[node name="AnimationManager" type="Node" parent="." unique_id=1990112030 node_paths=PackedStringArray("TargetSwitch", "TargetAnimationPlayer")]
script = ExtResource("8_4smss")
TargetSwitch = NodePath("..")
TargetAnimationPlayer = NodePath("../AnimationPlayer")
AnimationEnabled = &"Enabled"
AnimationDisabled = &"Disabled"
[editable path="blockbench_export2"]