Created a Generator Panel with Key and Shape keyed the button being pressed and made it animate when clicked in game
This commit is contained in:
58
Assets/Objects/generator_panel.tscn
Normal file
58
Assets/Objects/generator_panel.tscn
Normal file
@ -0,0 +1,58 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://bpc015tk4ehtg"]
|
||||
|
||||
[ext_resource type="Script" path="res://Assets/scripts/Generator Panel.gd" id="1_i8xx2"]
|
||||
[ext_resource type="PackedScene" uid="uid://r4bpij06p34a" path="res://Blender Files/Objects/GeneratorPanel.blend" id="2_4k7uo"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_xn70b"]
|
||||
size = Vector3(0.322693, 0.569824, 0.078186)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_5a75i"]
|
||||
resource_name = "Press"
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("GeneratorPanel/Circle:blend_shapes/ButtonPressed")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0, 0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.5, 1)
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_qkow4"]
|
||||
length = 0.001
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("GeneratorPanel/Circle:blend_shapes/ButtonPressed")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ed3dm"]
|
||||
_data = {
|
||||
"Press": SubResource("Animation_5a75i"),
|
||||
"RESET": SubResource("Animation_qkow4")
|
||||
}
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D"]
|
||||
script = ExtResource("1_i8xx2")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.000640869, 0.0495605, 0.0411072)
|
||||
shape = SubResource("BoxShape3D_xn70b")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_ed3dm")
|
||||
}
|
||||
|
||||
[node name="GeneratorPanel" parent="." instance=ExtResource("2_4k7uo")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.0453592)
|
||||
|
||||
[editable path="GeneratorPanel"]
|
||||
10
Assets/scripts/Generator Panel.gd
Normal file
10
Assets/scripts/Generator Panel.gd
Normal file
@ -0,0 +1,10 @@
|
||||
extends StaticBody3D
|
||||
|
||||
@export var promt_message:String = "press e"
|
||||
@export var promt_key:String
|
||||
|
||||
signal Generator_Started
|
||||
|
||||
func interact(player):
|
||||
$AnimationPlayer.play("Press")
|
||||
emit_signal("Generator_Started")
|
||||
BIN
Assets/textures/lock.png
Normal file
BIN
Assets/textures/lock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
36
Assets/textures/lock.png.import
Normal file
36
Assets/textures/lock.png.import
Normal file
@ -0,0 +1,36 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cb0o3c5fuy7f"
|
||||
path.s3tc="res://.godot/imported/lock.png-95b8d267f535363d56fddd9b641337c3.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/lock.png-95b8d267f535363d56fddd9b641337c3.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/textures/lock.png"
|
||||
dest_files=["res://.godot/imported/lock.png-95b8d267f535363d56fddd9b641337c3.s3tc.ctex", "res://.godot/imported/lock.png-95b8d267f535363d56fddd9b641337c3.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
Reference in New Issue
Block a user