initial shit
This commit is contained in:
9
Objects/BaseMaterial.tres
Normal file
9
Objects/BaseMaterial.tres
Normal file
@@ -0,0 +1,9 @@
|
||||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://ckdlnf7tbmvnf"]
|
||||
|
||||
[resource]
|
||||
albedo_color = Color(0.29954746, 0.29954746, 0.29954743, 1)
|
||||
metallic = 0.4
|
||||
metallic_specular = 0.88
|
||||
roughness = 0.16
|
||||
clearcoat_enabled = true
|
||||
clearcoat_roughness = 0.18
|
||||
48
Objects/I3PositionSwitch.tscn
Normal file
48
Objects/I3PositionSwitch.tscn
Normal file
@@ -0,0 +1,48 @@
|
||||
[gd_scene format=3 uid="uid://3noosdfr8vt2"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://mbjs5s2p30dh" path="res://Objects/Scripts/I3PositionSwitch.gd" id="1_j5pdk"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://do5kbmfabhhvr" path="res://Assets/Models/I3PositionSwitchBase.obj" id="2_ytasq"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://dkhw5hal4yx0b" path="res://Assets/Models/I3PositionSwitchCap.obj" id="3_482r1"]
|
||||
[ext_resource type="AudioStream" uid="uid://3u4ofv7lf7oq" path="res://Assets/switch.mp3" id="3_rhkfk"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ytasq"]
|
||||
metallic = 1.0
|
||||
metallic_specular = 0.0
|
||||
roughness = 0.3
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_ngrym"]
|
||||
size = Vector3(0.8198242, 0.15435791, 0.79818726)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_482r1"]
|
||||
albedo_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_qpjy5"]
|
||||
albedo_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_qhbx7"]
|
||||
albedo_color = Color(0.47788018, 0.47788012, 0.47788012, 1)
|
||||
|
||||
[node name="I3PositionSwitch" type="Node3D" unique_id=454776149]
|
||||
script = ExtResource("1_j5pdk")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=1632250786]
|
||||
mesh = ExtResource("2_ytasq")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_ytasq")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=761288102]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" unique_id=1351218460]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.007939994, 0.19003978, 0.014663696)
|
||||
shape = SubResource("BoxShape3D_ngrym")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="StaticBody3D" unique_id=2147425933]
|
||||
mesh = ExtResource("3_482r1")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_482r1")
|
||||
surface_material_override/1 = SubResource("StandardMaterial3D_qpjy5")
|
||||
surface_material_override/2 = SubResource("StandardMaterial3D_qhbx7")
|
||||
|
||||
[node name="Sound" type="AudioStreamPlayer3D" parent="." unique_id=1837252552]
|
||||
stream = ExtResource("3_rhkfk")
|
||||
volume_db = -15.0
|
||||
|
||||
[connection signal="input_event" from="StaticBody3D" to="." method="_on_static_body_3d_input_event"]
|
||||
79
Objects/IButton.tscn
Normal file
79
Objects/IButton.tscn
Normal file
@@ -0,0 +1,79 @@
|
||||
[gd_scene format=3 uid="uid://3gnlcoefcg04"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://lc16dii2q86w" path="res://Objects/Scripts/IButton.gd" id="1_3ujms"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://bn0u7x5cdhqeq" path="res://Assets/Models/IButtonBase.obj" id="1_muiik"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://c14lv8v6bduhu" path="res://Assets/Models/IButtonCap.obj" id="2_3ujms"]
|
||||
[ext_resource type="FontFile" uid="uid://drt3ca0d33tq7" path="res://Assets/font.otf" id="3_548fc"]
|
||||
[ext_resource type="AudioStream" uid="uid://3u4ofv7lf7oq" path="res://Assets/switch.mp3" id="5_gopp6"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_43xld"]
|
||||
size = Vector3(0.87475586, 0.5344238, 0.8363037)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_548fc"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_3ujms"]
|
||||
length = 0.001
|
||||
tracks/0/type = "position_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("StaticBody3D")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_43xld"]
|
||||
resource_name = "interact"
|
||||
length = 0.033333335
|
||||
tracks/0/type = "position_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("StaticBody3D")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0, 0.033333335, 1, 0, -0.055, 0)
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_44wre"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_3ujms"),
|
||||
&"interact": SubResource("Animation_43xld")
|
||||
}
|
||||
|
||||
[node name="IButton" type="Node3D" unique_id=161856390]
|
||||
script = ExtResource("1_3ujms")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=149645064]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||
mesh = ExtResource("1_muiik")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1737148302]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" unique_id=6776762]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0015869141, 0.9676255, -0.006164551)
|
||||
shape = SubResource("BoxShape3D_43xld")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="StaticBody3D" unique_id=1645284239]
|
||||
mesh = ExtResource("2_3ujms")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_548fc")
|
||||
|
||||
[node name="Label3D" type="Label3D" parent="StaticBody3D" unique_id=373480060]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 1.1993433, 0)
|
||||
alpha_cut = 2
|
||||
alpha_scissor_threshold = 0.0
|
||||
alpha_hash_scale = 0.0
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
outline_modulate = Color(1, 1, 1, 1)
|
||||
text = "text"
|
||||
font = ExtResource("3_548fc")
|
||||
font_size = 44
|
||||
outline_size = 0
|
||||
uppercase = true
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1631573490]
|
||||
libraries/ = SubResource("AnimationLibrary_44wre")
|
||||
|
||||
[node name="Sound" type="AudioStreamPlayer3D" parent="." unique_id=14794157]
|
||||
stream = ExtResource("5_gopp6")
|
||||
volume_db = -15.0
|
||||
|
||||
[connection signal="input_event" from="StaticBody3D" to="." method="_on_static_body_3d_input_event"]
|
||||
29
Objects/ILed.tscn
Normal file
29
Objects/ILed.tscn
Normal file
@@ -0,0 +1,29 @@
|
||||
[gd_scene format=3 uid="uid://b1cwggrpop0lm"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b4i12wekeb7ex" path="res://Objects/Scripts/ILed.gd" id="1_ev8yx"]
|
||||
|
||||
[sub_resource type="CylinderMesh" id="CylinderMesh_cagf5"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_rej0y"]
|
||||
albedo_color = Color(0.29219002, 0.29219005, 0.29219002, 1)
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_xuk2b"]
|
||||
|
||||
[node name="ILed" type="Node3D" unique_id=2112223431]
|
||||
script = ExtResource("1_ev8yx")
|
||||
onColor = Color(0.6784314, 0, 0, 1)
|
||||
glowMultiplier = 10
|
||||
|
||||
[node name="BaseA" type="MeshInstance3D" parent="." unique_id=1760128822]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||
mesh = SubResource("CylinderMesh_cagf5")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_rej0y")
|
||||
|
||||
[node name="BaseB" type="MeshInstance3D" parent="." unique_id=1293109455]
|
||||
transform = Transform3D(0.45, 0, 0, 0, 0.45, 0, 0, 0, 0.45, 0, 0.06169519, 0)
|
||||
mesh = SubResource("CylinderMesh_cagf5")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_rej0y")
|
||||
|
||||
[node name="Light" type="MeshInstance3D" parent="." unique_id=1779562743]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.231, 0, 0, 0, 0.5, 0, 0.44757205, 0)
|
||||
mesh = SubResource("SphereMesh_xuk2b")
|
||||
76
Objects/ISwitch.tscn
Normal file
76
Objects/ISwitch.tscn
Normal file
@@ -0,0 +1,76 @@
|
||||
[gd_scene format=3 uid="uid://c4skbeito3suj"]
|
||||
|
||||
[ext_resource type="ArrayMesh" uid="uid://b5ok22cbta76k" path="res://Assets/Models/ISwitchBase.obj" id="1_0yoy5"]
|
||||
[ext_resource type="Script" uid="uid://bnusj72egf6sw" path="res://Objects/Scripts/ISwitch.gd" id="1_b84el"]
|
||||
[ext_resource type="Material" uid="uid://ckdlnf7tbmvnf" path="res://Objects/BaseMaterial.tres" id="2_85clc"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://bdjr38o7iuajh" path="res://Assets/Models/ISwitchCap.obj" id="2_b84el"]
|
||||
[ext_resource type="AudioStream" uid="uid://3u4ofv7lf7oq" path="res://Assets/switch.mp3" id="5_85clc"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_b2608"]
|
||||
size = Vector3(0.17260742, 0.42382813, 0.15209961)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vks8t"]
|
||||
albedo_color = Color(0.5890956, 0.5890956, 0.5890956, 1)
|
||||
metallic = 1.0
|
||||
metallic_specular = 0.0
|
||||
roughness = 0.27
|
||||
|
||||
[sub_resource type="Animation" id="Animation_i8co2"]
|
||||
length = 0.001
|
||||
tracks/0/type = "rotation_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("StaticBody3D")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_0yoy5"]
|
||||
resource_name = "interact"
|
||||
length = 0.033333335
|
||||
tracks/0/type = "rotation_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("StaticBody3D")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, -0.21644, 0, 0, 0.976296, 0.033333335, 1, 0.21644, 0, 0, 0.976296)
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_b84el"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_i8co2"),
|
||||
&"interact": SubResource("Animation_0yoy5")
|
||||
}
|
||||
|
||||
[node name="ISwitch" type="Node3D" unique_id=308040824]
|
||||
script = ExtResource("1_b84el")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=1157301497]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
|
||||
material_override = ExtResource("2_85clc")
|
||||
mesh = ExtResource("1_0yoy5")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1975278460]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0.22, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" unique_id=2033531582]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.001953125, 0.158194, -0.013366684)
|
||||
shape = SubResource("BoxShape3D_b2608")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="StaticBody3D" unique_id=121790667]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.44, 0)
|
||||
mesh = ExtResource("2_b84el")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_vks8t")
|
||||
surface_material_override/1 = SubResource("StandardMaterial3D_vks8t")
|
||||
surface_material_override/2 = SubResource("StandardMaterial3D_vks8t")
|
||||
surface_material_override/3 = SubResource("StandardMaterial3D_vks8t")
|
||||
surface_material_override/4 = SubResource("StandardMaterial3D_vks8t")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=687151194]
|
||||
libraries/ = SubResource("AnimationLibrary_b84el")
|
||||
|
||||
[node name="Sound" type="AudioStreamPlayer3D" parent="." unique_id=439972111]
|
||||
stream = ExtResource("5_85clc")
|
||||
volume_db = -20.0
|
||||
|
||||
[connection signal="input_event" from="StaticBody3D" to="." method="_on_static_body_3d_input_event"]
|
||||
75
Objects/SGauge.tscn
Normal file
75
Objects/SGauge.tscn
Normal file
@@ -0,0 +1,75 @@
|
||||
[gd_scene format=3 uid="uid://covkw4kvf310f"]
|
||||
|
||||
[ext_resource type="Material" uid="uid://ckdlnf7tbmvnf" path="res://Objects/BaseMaterial.tres" id="1_p76p4"]
|
||||
[ext_resource type="Script" uid="uid://1n13rixvaeqm" path="res://Objects/Scripts/SGauge.gd" id="1_w21a8"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://do5kbmfabhhvr" path="res://Assets/Models/I3PositionSwitchBase.obj" id="3_rfkns"]
|
||||
[ext_resource type="Texture2D" uid="uid://d3cn3q6h2uyyw" path="res://Assets/gauge.png" id="4_fg1cu"]
|
||||
[ext_resource type="Texture2D" uid="uid://g6tb0l6bf0v" path="res://Assets/gauge.svg" id="5_b41s0"]
|
||||
|
||||
[sub_resource type="CylinderMesh" id="CylinderMesh_w21a8"]
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_ennpa"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2b3nl"]
|
||||
albedo_color = Color(0.60327005, 0, 0.08218051, 1)
|
||||
emission_enabled = true
|
||||
emission = Color(1, 0, 0, 1)
|
||||
emission_energy_multiplier = 1.35
|
||||
clearcoat_enabled = true
|
||||
clearcoat_roughness = 0.0
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7dfcj"]
|
||||
albedo_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dyc0b"]
|
||||
transparency = 4
|
||||
blend_mode = 1
|
||||
albedo_color = Color(1, 1, 1, 0.011764706)
|
||||
metallic = 1.0
|
||||
metallic_specular = 0.0
|
||||
roughness = 0.3
|
||||
clearcoat_enabled = true
|
||||
clearcoat_roughness = 0.0
|
||||
clearcoat_texture = ExtResource("5_b41s0")
|
||||
|
||||
[node name="SGauge" type="Node3D" unique_id=1241352669]
|
||||
script = ExtResource("1_w21a8")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=1442682803]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.038215816, 0, 0, 0, 1, 0, 0, 0)
|
||||
material_override = ExtResource("1_p76p4")
|
||||
mesh = SubResource("CylinderMesh_w21a8")
|
||||
|
||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="." unique_id=1810834208]
|
||||
transform = Transform3D(0.886, 0, 0, 0, 0.026, 0, 0, 0, 0.886, 0, 0.06214194, 0)
|
||||
material_override = ExtResource("1_p76p4")
|
||||
mesh = SubResource("CylinderMesh_w21a8")
|
||||
|
||||
[node name="Node3D2" type="Node3D" parent="." unique_id=1026138035]
|
||||
|
||||
[node name="Node3D" type="Node3D" parent="Node3D2" unique_id=1156784682]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.3)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Node3D2/Node3D" unique_id=1884179760]
|
||||
transform = Transform3D(0.05, 0, 0, 0, -7.195437e-09, -0.05, 0, 0.16461241, -2.1855695e-09, 0, 0.094, -0.12306601)
|
||||
mesh = SubResource("CapsuleMesh_ennpa")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_2b3nl")
|
||||
|
||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Node3D2/Node3D" unique_id=636240923]
|
||||
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.02357088, -0.3)
|
||||
mesh = SubResource("CylinderMesh_w21a8")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_7dfcj")
|
||||
|
||||
[node name="MeshInstance3D3" type="MeshInstance3D" parent="." unique_id=26108698]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.041466653, 0)
|
||||
mesh = ExtResource("3_rfkns")
|
||||
surface_material_override/0 = ExtResource("1_p76p4")
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="." unique_id=317630381]
|
||||
transform = Transform3D(0.1, 0, 0, 0, -4.371139e-09, 0.1, 0, -0.1, -4.371139e-09, 0, 0.09025848, 1.4262302e-07)
|
||||
texture = ExtResource("4_fg1cu")
|
||||
|
||||
[node name="MeshInstance3D4" type="MeshInstance3D" parent="." unique_id=762199643]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.038215816, 0, 0, 0, 1, 0, 0.15286298, 0)
|
||||
mesh = SubResource("CylinderMesh_w21a8")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_dyc0b")
|
||||
20
Objects/SLabel.tscn
Normal file
20
Objects/SLabel.tscn
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene format=3 uid="uid://dwd5j3opt1kf"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://drt3ca0d33tq7" path="res://Assets/font.otf" id="1_4qu2l"]
|
||||
[ext_resource type="Script" uid="uid://d1p6pro5cdj8d" path="res://Objects/Scripts/SLabel.gd" id="1_l7fp2"]
|
||||
|
||||
[node name="SLabel" type="Node3D" unique_id=29466195]
|
||||
script = ExtResource("1_l7fp2")
|
||||
|
||||
[node name="Label3D" type="Label3D" parent="." unique_id=1161073044]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 0, 0)
|
||||
alpha_cut = 2
|
||||
alpha_scissor_threshold = 0.0
|
||||
alpha_hash_scale = 0.0
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
outline_modulate = Color(1, 1, 1, 1)
|
||||
text = "text"
|
||||
font = ExtResource("1_4qu2l")
|
||||
font_size = 44
|
||||
outline_size = 0
|
||||
uppercase = true
|
||||
6
Objects/SUpdate.tscn
Normal file
6
Objects/SUpdate.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://dsf43ptd66s8u"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://7liu0n270lj0" path="res://Objects/Scripts/SUpdate.gd" id="1_v7bve"]
|
||||
|
||||
[node name="SUpdate" type="Node3D" unique_id=2038046630]
|
||||
script = ExtResource("1_v7bve")
|
||||
33
Objects/Scripts/I3PositionSwitch.gd
Normal file
33
Objects/Scripts/I3PositionSwitch.gd
Normal file
@@ -0,0 +1,33 @@
|
||||
extends Node3D
|
||||
|
||||
signal incremented
|
||||
signal decremented
|
||||
signal switchUpdated
|
||||
|
||||
@export var State = 0
|
||||
@export var isLoopingUpdate : bool = false
|
||||
|
||||
func _interact_press(is_alt_click: bool = false) -> void:
|
||||
if is_alt_click:
|
||||
if State != 0:
|
||||
State -= 1
|
||||
$Sound.play()
|
||||
emit_signal("decremented")
|
||||
emit_signal("switchUpdated")
|
||||
else:
|
||||
if State != 2:
|
||||
State += 1
|
||||
$Sound.play()
|
||||
emit_signal("incremented")
|
||||
emit_signal("switchUpdated")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if State == 0:
|
||||
$StaticBody3D.rotation_degrees = Vector3(0, 45, 0)
|
||||
elif State == 1:
|
||||
$StaticBody3D.rotation_degrees = Vector3(0, 0, 0)
|
||||
elif State == 2:
|
||||
$StaticBody3D.rotation_degrees = Vector3(0, -45, 0)
|
||||
|
||||
if isLoopingUpdate:
|
||||
emit_signal("switchUpdated")
|
||||
1
Objects/Scripts/I3PositionSwitch.gd.uid
Normal file
1
Objects/Scripts/I3PositionSwitch.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://mbjs5s2p30dh
|
||||
59
Objects/Scripts/IButton.gd
Normal file
59
Objects/Scripts/IButton.gd
Normal file
@@ -0,0 +1,59 @@
|
||||
extends Node
|
||||
|
||||
signal buttonPressed
|
||||
signal buttonReleased
|
||||
signal buttonUpdated
|
||||
|
||||
@export var isBeingPressed = false
|
||||
@export var text : String
|
||||
@export var isLoopingUpdate : bool = false
|
||||
@export var color : Color
|
||||
|
||||
# FIX: Do not instantly assign an empty .new() if it might have been loaded
|
||||
var material : StandardMaterial3D
|
||||
|
||||
func _ready() -> void:
|
||||
# Reconstruct or override the material instance cleanly on load
|
||||
material = StandardMaterial3D.new()
|
||||
material.albedo_color = color
|
||||
|
||||
ButtonAnimation.loop_mode = Animation.LOOP_NONE
|
||||
$StaticBody3D/Label3D.text = text
|
||||
$StaticBody3D/MeshInstance3D.material_override = material
|
||||
|
||||
# Keep animation visually synced with the saved press state
|
||||
if isBeingPressed:
|
||||
$AnimationPlayer.play("interact")
|
||||
$AnimationPlayer.advance(ButtonAnimation.length)
|
||||
else:
|
||||
$AnimationPlayer.play_backwards("interact")
|
||||
|
||||
@onready var ButtonAnimation = $AnimationPlayer.get_animation("interact")
|
||||
|
||||
func _press():
|
||||
if not isBeingPressed:
|
||||
emit_signal("buttonPressed")
|
||||
isBeingPressed = true
|
||||
$AnimationPlayer.play("interact")
|
||||
$Sound.pitch_scale = 1.5
|
||||
$Sound.play()
|
||||
emit_signal("buttonUpdated")
|
||||
|
||||
func _release():
|
||||
if isBeingPressed:
|
||||
emit_signal("buttonReleased")
|
||||
isBeingPressed = false
|
||||
$AnimationPlayer.play_backwards("interact")
|
||||
$Sound.pitch_scale = 1.3
|
||||
$Sound.play()
|
||||
emit_signal("buttonUpdated")
|
||||
|
||||
func _interact_press(is_alt_click: bool = false) -> void:
|
||||
_press()
|
||||
|
||||
func _interact_release() -> void:
|
||||
_release()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if isLoopingUpdate:
|
||||
emit_signal("buttonUpdated")
|
||||
1
Objects/Scripts/IButton.gd.uid
Normal file
1
Objects/Scripts/IButton.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://lc16dii2q86w
|
||||
26
Objects/Scripts/ILed.gd
Normal file
26
Objects/Scripts/ILed.gd
Normal file
@@ -0,0 +1,26 @@
|
||||
extends Node3D
|
||||
|
||||
var LampMaterial = StandardMaterial3D.new();
|
||||
@export var isLampOn = false;
|
||||
@export_category("Lamp Config")
|
||||
@export var onColor : Color;
|
||||
@export var glowMultiplier : int;
|
||||
|
||||
func _ready() -> void:
|
||||
$Light.material_override = LampMaterial;
|
||||
|
||||
func startGlowing():
|
||||
LampMaterial.emission_enabled = true;
|
||||
LampMaterial.emission = onColor;
|
||||
LampMaterial.emission_energy_multiplier = glowMultiplier
|
||||
|
||||
func stopGlowing():
|
||||
LampMaterial.emission_energy_multiplier = 0.0;
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if isLampOn:
|
||||
LampMaterial.albedo_color = onColor;
|
||||
startGlowing();
|
||||
else:
|
||||
LampMaterial.albedo_color = Color(0.069, 0.069, 0.069, 1.0);
|
||||
stopGlowing();
|
||||
1
Objects/Scripts/ILed.gd.uid
Normal file
1
Objects/Scripts/ILed.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b4i12wekeb7ex
|
||||
45
Objects/Scripts/ISwitch.gd
Normal file
45
Objects/Scripts/ISwitch.gd
Normal file
@@ -0,0 +1,45 @@
|
||||
extends Node
|
||||
|
||||
signal turnedOn
|
||||
signal turnedOff
|
||||
signal switchUpdated
|
||||
|
||||
@export var isOn = false
|
||||
@export var isLoopingUpdate : bool = false
|
||||
@onready var ButtonAnimation = $AnimationPlayer.get_animation("interact")
|
||||
|
||||
func _ready() -> void:
|
||||
ButtonAnimation.loop_mode = Animation.LOOP_NONE
|
||||
# FIX: Look at the saved state before forcing the animation closed!
|
||||
if isOn:
|
||||
$AnimationPlayer.play("interact")
|
||||
# Advance to the end immediately so it doesn't play the visual transition on load
|
||||
$AnimationPlayer.advance(ButtonAnimation.length)
|
||||
else:
|
||||
$AnimationPlayer.play_backwards("interact")
|
||||
|
||||
func _press():
|
||||
if not isOn:
|
||||
isOn = true
|
||||
$AnimationPlayer.play("interact")
|
||||
$Sound.play()
|
||||
emit_signal("turnedOn")
|
||||
emit_signal("switchUpdated")
|
||||
|
||||
func _release():
|
||||
if isOn:
|
||||
isOn = false
|
||||
$AnimationPlayer.play_backwards("interact")
|
||||
$Sound.play()
|
||||
emit_signal("turnedOff")
|
||||
emit_signal("switchUpdated")
|
||||
|
||||
func _interact_press(is_alt_click: bool = false) -> void:
|
||||
if isOn:
|
||||
_release()
|
||||
else:
|
||||
_press()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if isLoopingUpdate:
|
||||
emit_signal("switchUpdated")
|
||||
1
Objects/Scripts/ISwitch.gd.uid
Normal file
1
Objects/Scripts/ISwitch.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bnusj72egf6sw
|
||||
10
Objects/Scripts/SGauge.gd
Normal file
10
Objects/Scripts/SGauge.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends Node3D
|
||||
|
||||
@export var Value : int
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
# 1. Remap the value
|
||||
var degree_value: float = remap(Value, 1.0, 100.0, 360.0 - 20, 25)
|
||||
|
||||
# 2. Assign a fresh Vector3 to rotation_degrees
|
||||
$Node3D2.rotation_degrees = Vector3(0.0, degree_value, 0.0)
|
||||
1
Objects/Scripts/SGauge.gd.uid
Normal file
1
Objects/Scripts/SGauge.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://1n13rixvaeqm
|
||||
8
Objects/Scripts/SLabel.gd
Normal file
8
Objects/Scripts/SLabel.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
extends Node3D
|
||||
|
||||
@export var Text : String;
|
||||
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
$Label3D.text = Text;
|
||||
1
Objects/Scripts/SLabel.gd.uid
Normal file
1
Objects/Scripts/SLabel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d1p6pro5cdj8d
|
||||
9
Objects/Scripts/SUpdate.gd
Normal file
9
Objects/Scripts/SUpdate.gd
Normal file
@@ -0,0 +1,9 @@
|
||||
extends Node3D
|
||||
|
||||
signal castUpdate
|
||||
|
||||
@export var isActive:bool = false;
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if isActive:
|
||||
emit_signal("castUpdate")
|
||||
1
Objects/Scripts/SUpdate.gd.uid
Normal file
1
Objects/Scripts/SUpdate.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://7liu0n270lj0
|
||||
Reference in New Issue
Block a user