Merge pull request #32 from Nitwel/testing
Add trash bin and improve sound effects
This commit is contained in:
commit
c6530db2e9
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -14,3 +14,4 @@
|
|||
*.obj filter=lfs diff=lfs merge=lfs -text
|
||||
*.mtl filter=lfs diff=lfs merge=lfs -text
|
||||
*.wav filter=lfs diff=lfs merge=lfs -text
|
||||
*.blend filter=lfs diff=lfs merge=lfs -text
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a8a8155035309697c511a28e0e7ca8912f19cb4ddb705be118ec5a0740336d29
|
||||
size 4088828
|
||||
oid sha256:d7d0bc9d14c5e8b172f5e3d5671f93ee7b67f62d82ec231f9f91792f30fc3bd9
|
||||
size 4015387
|
||||
|
|
3
assets/models/trash_bin/cross.png
Normal file
3
assets/models/trash_bin/cross.png
Normal file
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7edf1d21866d37549789aa3baef58b5e956ece16c0327c26e92649f389cd9056
|
||||
size 991
|
34
assets/models/trash_bin/cross.png.import
Normal file
34
assets/models/trash_bin/cross.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://s6fp7mqjrni0"
|
||||
path="res://.godot/imported/cross.png-cdc4200b4741b1c53e6547059c1eeb4d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/trash_bin/cross.png"
|
||||
dest_files=["res://.godot/imported/cross.png-cdc4200b4741b1c53e6547059c1eeb4d.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
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=1
|
3
assets/models/trash_bin/trash_bin.gltf
Normal file
3
assets/models/trash_bin/trash_bin.gltf
Normal file
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:430fe8b8428bf05b8d72e62ecccd0f167aff255de034b007f259b87d6e975f94
|
||||
size 1299456
|
32
assets/models/trash_bin/trash_bin.gltf.import
Normal file
32
assets/models/trash_bin/trash_bin.gltf.import
Normal file
|
@ -0,0 +1,32 @@
|
|||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://cj42our8uhfq6"
|
||||
path="res://.godot/imported/trash_bin.gltf-00f08fd370f3ef175290a8724bc98fbe.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/trash_bin/trash_bin.gltf"
|
||||
dest_files=["res://.godot/imported/trash_bin.gltf-00f08fd370f3ef175290a8724bc98fbe.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
gltf/embedded_image_handling=1
|
3
assets/models/trash_bin/trash_bin.png
Normal file
3
assets/models/trash_bin/trash_bin.png
Normal file
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:82509704bbbe2c578f8fb7d974a3179e1ac27d1ef248d606788aa1fc7bfd496a
|
||||
size 945321
|
34
assets/models/trash_bin/trash_bin.png.import
Normal file
34
assets/models/trash_bin/trash_bin.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://di7g13y7krle0"
|
||||
path="res://.godot/imported/trash_bin.png-e418852ac63604cea63dd00ccf8fd222.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/trash_bin/trash_bin.png"
|
||||
dest_files=["res://.godot/imported/trash_bin.png-e418852ac63604cea63dd00ccf8fd222.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
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=1
|
3
assets/models/trash_bin/trash_bin_trash_bin.png
Normal file
3
assets/models/trash_bin/trash_bin_trash_bin.png
Normal file
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:82b66bd89513d6bb26219be53c57b19a9ac67fef461a9ac4ee80b421a3e14e0f
|
||||
size 844591
|
37
assets/models/trash_bin/trash_bin_trash_bin.png.import
Normal file
37
assets/models/trash_bin/trash_bin_trash_bin.png.import
Normal file
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://wrc2wki2dc2f"
|
||||
path.s3tc="res://.godot/imported/trash_bin_trash_bin.png-25f979e82f0cb781d5118607430651f5.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/trash_bin_trash_bin.png-25f979e82f0cb781d5118607430651f5.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
generator_parameters={}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/models/trash_bin/trash_bin_trash_bin.png"
|
||||
dest_files=["res://.godot/imported/trash_bin_trash_bin.png-25f979e82f0cb781d5118607430651f5.s3tc.ctex", "res://.godot/imported/trash_bin_trash_bin.png-25f979e82f0cb781d5118607430651f5.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
|
3
assets/sound/close_menu.wav
Normal file
3
assets/sound/close_menu.wav
Normal file
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:33fe15d932e837c510f71d906a4a56ff7b5f6f329f4c67fa084dee883da9f475
|
||||
size 100396
|
24
assets/sound/close_menu.wav.import
Normal file
24
assets/sound/close_menu.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
|||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://dfqnvsyxyifxa"
|
||||
path="res://.godot/imported/close_menu.wav-c3ab6be18de30d0a6f79d056b38c22d1.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sound/close_menu.wav"
|
||||
dest_files=["res://.godot/imported/close_menu.wav-c3ab6be18de30d0a6f79d056b38c22d1.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=0
|
3
assets/sound/open_menu.wav
Normal file
3
assets/sound/open_menu.wav
Normal file
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b475413c4d2e2558b6d1e78d442e7c4bc97452e9c4f3d59b6bd48a87f4898a9e
|
||||
size 100396
|
24
assets/sound/open_menu.wav.import
Normal file
24
assets/sound/open_menu.wav.import
Normal file
|
@ -0,0 +1,24 @@
|
|||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://c83d1f5u1ivma"
|
||||
path="res://.godot/imported/open_menu.wav-1958af615b69d23f180305ab9fd30ba3.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sound/open_menu.wav"
|
||||
dest_files=["res://.godot/imported/open_menu.wav-1958af615b69d23f180305ab9fd30ba3.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=0
|
3
assets/trash_bin.blend
Normal file
3
assets/trash_bin.blend
Normal file
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f48cf7795dee0577c5183968eb16d742dc06248965e8871c7e5d2126bf439f4f
|
||||
size 957708
|
65
content/controller_left.gd
Normal file
65
content/controller_left.gd
Normal file
|
@ -0,0 +1,65 @@
|
|||
extends XRController3D
|
||||
|
||||
@onready var area = $trash_bin/Area3D
|
||||
@onready var trash_bin = $trash_bin
|
||||
@onready var animation = $AnimationPlayer
|
||||
|
||||
var to_delete = []
|
||||
var trash_bin_visible: bool = true:
|
||||
set(value):
|
||||
if trash_bin_visible == value:
|
||||
return
|
||||
|
||||
if value:
|
||||
add_child(trash_bin)
|
||||
else:
|
||||
if animation.is_playing():
|
||||
await animation.animation_finished
|
||||
remove_child(trash_bin)
|
||||
|
||||
trash_bin_visible = value
|
||||
|
||||
var trash_bin_large: bool = false:
|
||||
set(value):
|
||||
if trash_bin_large == value:
|
||||
return
|
||||
|
||||
if value:
|
||||
animation.play("add_trashbin")
|
||||
else:
|
||||
animation.play_backwards("add_trashbin")
|
||||
|
||||
trash_bin_large = value
|
||||
|
||||
func _ready():
|
||||
trash_bin_visible = false
|
||||
|
||||
Events.on_grab_down.connect(func(event):
|
||||
trash_bin_visible = event.target.is_in_group("entity")
|
||||
)
|
||||
|
||||
Events.on_grab_move.connect(func(event):
|
||||
if !trash_bin_visible:
|
||||
return
|
||||
|
||||
if event.target.is_in_group("entity") && area.overlaps_body(event.target):
|
||||
if !to_delete.has(event.target):
|
||||
to_delete.append(event.target)
|
||||
trash_bin_large = true
|
||||
|
||||
else:
|
||||
to_delete.erase(event.target)
|
||||
trash_bin_large = false
|
||||
|
||||
)
|
||||
|
||||
Events.on_grab_up.connect(func(event):
|
||||
if !trash_bin_visible:
|
||||
return
|
||||
|
||||
for entity in to_delete:
|
||||
entity.queue_free()
|
||||
to_delete.clear()
|
||||
trash_bin_large = false
|
||||
trash_bin_visible = false
|
||||
)
|
121
content/controller_left.tscn
Normal file
121
content/controller_left.tscn
Normal file
|
@ -0,0 +1,121 @@
|
|||
[gd_scene load_steps=10 format=3 uid="uid://b30w6tywfj4fp"]
|
||||
|
||||
[ext_resource type="Script" path="res://content/controller_left.gd" id="1_2j3qs"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3kdssrmv84kv" path="res://content/ui/menu/menu.tscn" id="1_ccbr3"]
|
||||
[ext_resource type="PackedScene" uid="uid://cj42our8uhfq6" path="res://assets/models/trash_bin/trash_bin.gltf" id="3_m33ce"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_m58yb"]
|
||||
ao_enabled = true
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_ir3co"]
|
||||
material = SubResource("StandardMaterial3D_m58yb")
|
||||
size = Vector3(0.01, 0.01, 0.01)
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_x2eyr"]
|
||||
height = 0.105954
|
||||
radius = 0.0447927
|
||||
|
||||
[sub_resource type="Animation" id="Animation_7owc4"]
|
||||
length = 0.001
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("trash_bin:scale:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("trash_bin:scale:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/2/type = "bezier"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("trash_bin:scale:z")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_hax52"]
|
||||
resource_name = "add_trashbin"
|
||||
length = 0.3
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("trash_bin:scale:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0, 0.04, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.3)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("trash_bin:scale:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0, 0.04, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.3)
|
||||
}
|
||||
tracks/2/type = "bezier"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("trash_bin:scale:z")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0.03, -0.25, 0, 0.25, 0, 0.04, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.3)
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_hkli8"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_7owc4"),
|
||||
"add_trashbin": SubResource("Animation_hax52")
|
||||
}
|
||||
|
||||
[node name="XRControllerLeft" type="XRController3D"]
|
||||
tracker = &"left_hand"
|
||||
pose = &"aim"
|
||||
script = ExtResource("1_2j3qs")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("BoxMesh_ir3co")
|
||||
|
||||
[node name="Menu" parent="." instance=ExtResource("1_ccbr3")]
|
||||
transform = Transform3D(1, -0.000382732, -0.000120985, 8.65898e-05, 0.5, -0.866025, 0.000391948, 0.866025, 0.5, 0.0669508, 0.0876772, -0.101157)
|
||||
|
||||
[node name="trash_bin" parent="." instance=ExtResource("3_m33ce")]
|
||||
transform = Transform3D(0.03, 0, 0, 0, 0.03, 0, 0, 0, 0.03, 0.106903, -0.228617, 0.132214)
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="trash_bin"]
|
||||
transform = Transform3D(25, 0, 0, 0, 25, 0, 0, 0, 25, 0, 0, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="trash_bin/Area3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0542412, 0)
|
||||
shape = SubResource("CylinderShape3D_x2eyr")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_hkli8")
|
||||
}
|
|
@ -90,7 +90,7 @@ top_radius = 0.006
|
|||
bottom_radius = 0.006
|
||||
height = 0.004
|
||||
|
||||
[node name="Light" type="StaticBody3D"]
|
||||
[node name="Light" type="StaticBody3D" groups=["entity"]]
|
||||
script = ExtResource("1_ykxy3")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
[sub_resource type="SphereShape3D" id="SphereShape3D_r20gc"]
|
||||
radius = 0.1
|
||||
|
||||
[node name="Sensor" type="StaticBody3D"]
|
||||
[node name="Sensor" type="StaticBody3D" groups=["entity"]]
|
||||
script = ExtResource("1_57ac8")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
|
|
|
@ -22,7 +22,7 @@ animations = [{
|
|||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="Switch" type="StaticBody3D"]
|
||||
[node name="Switch" type="StaticBody3D" groups=["entity"]]
|
||||
script = ExtResource("1_8ffhi")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://clc5dre31iskm" path="res://addons/godot-xr-tools/xr/start_xr.tscn" id="1_i4c04"]
|
||||
[ext_resource type="Script" path="res://content/raycast.gd" id="1_tsqxc"]
|
||||
[ext_resource type="Script" path="res://content/main.gd" id="1_uvrd4"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3kdssrmv84kv" path="res://content/ui/menu/menu.tscn" id="3_1tbp3"]
|
||||
[ext_resource type="PackedScene" uid="uid://b30w6tywfj4fp" path="res://content/controller_left.tscn" id="2_2lraw"]
|
||||
[ext_resource type="Texture2D" uid="uid://bo55nohs0wsgf" path="res://assets/materials/pointer.png" id="4_wcfej"]
|
||||
[ext_resource type="PackedScene" uid="uid://ctltchlf2j2r4" path="res://addons/xr-simulator/XRSimulator.tscn" id="5_3qc8g"]
|
||||
[ext_resource type="Material" uid="uid://bf5ina366dwm6" path="res://assets/materials/sky.material" id="5_wgwf8"]
|
||||
|
@ -33,18 +33,10 @@ script = ExtResource("1_uvrd4")
|
|||
[node name="XROrigin3D" type="XROrigin3D" parent="."]
|
||||
|
||||
[node name="XRCamera3D" type="XRCamera3D" parent="XROrigin3D"]
|
||||
transform = Transform3D(1, 2.47971e-10, 3.49246e-10, 9.47986e-12, 1, 2.08834e-08, 0, 4.54747e-13, 1, -7.27596e-12, 0.798091, 0.311748)
|
||||
transform = Transform3D(1, 2.18865e-10, 3.7835e-10, 3.85836e-11, 1, 2.08752e-08, -2.91038e-11, 8.6402e-12, 1, 0.0356344, 0.79808, 0.202806)
|
||||
|
||||
[node name="XRControllerLeft" type="XRController3D" parent="XROrigin3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.469893, 0.597213, -0.251112)
|
||||
tracker = &"left_hand"
|
||||
pose = &"aim"
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="XROrigin3D/XRControllerLeft"]
|
||||
mesh = SubResource("BoxMesh_ir3co")
|
||||
|
||||
[node name="Menu" parent="XROrigin3D/XRControllerLeft" instance=ExtResource("3_1tbp3")]
|
||||
transform = Transform3D(1, -0.000382732, -0.000120985, 8.65898e-05, 0.5, -0.866025, 0.000391948, 0.866025, 0.5, 0.0669508, 0.0876772, -0.101157)
|
||||
[node name="XRControllerLeft" parent="XROrigin3D" instance=ExtResource("2_2lraw")]
|
||||
transform = Transform3D(0.999999, -1.39633e-11, 0, 9.48075e-12, 1, 0, 0, 0, 1, -0.355145, 0.550439, -0.477945)
|
||||
|
||||
[node name="XRControllerRight" type="XRController3D" parent="XROrigin3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.488349, 0.559219, -0.2988)
|
||||
|
|
|
@ -72,14 +72,16 @@ func _on_button_released(button):
|
|||
_call_fn(_last_collided, "_on_click")
|
||||
_call_fn(_last_collided, "_on_press_up")
|
||||
_is_pressed = false
|
||||
_last_collided = null
|
||||
_moved = false
|
||||
"grip_click":
|
||||
if _is_grabbed:
|
||||
_call_fn(_last_collided, "_on_grab_up")
|
||||
_is_grabbed = false
|
||||
_last_collided = null
|
||||
_moved = false
|
||||
|
||||
func _call_fn(collider: Object, fn_name: String, node: Node3D = null, event = null):
|
||||
func _call_fn(collider: Variant, fn_name: String, node: Node3D = null, event = null):
|
||||
if collider == null:
|
||||
return
|
||||
|
||||
|
@ -111,3 +113,9 @@ func _call_fn(collider: Object, fn_name: String, node: Node3D = null, event = nu
|
|||
|
||||
if parent != null && parent is Node3D:
|
||||
_call_fn(collider, fn_name, parent, event)
|
||||
else:
|
||||
# in case the top has been reached
|
||||
_call_global_fn(fn_name, event)
|
||||
|
||||
func _call_global_fn(fn_name: String, event = null):
|
||||
Events.get(fn_name.substr(1)).emit(event)
|
||||
|
|
|
@ -65,8 +65,13 @@ func render():
|
|||
update_pages()
|
||||
page_number_label.set_text(str(page + 1) + " / " + str(pages))
|
||||
|
||||
previous_page_button.visible = page > 0
|
||||
next_page_button.visible = page < pages - 1
|
||||
var has_prev_page = page > 0
|
||||
var has_next_page = page < pages - 1
|
||||
|
||||
previous_page_button.visible = has_prev_page
|
||||
previous_page_button.disabled = !has_prev_page
|
||||
next_page_button.visible = has_next_page
|
||||
next_page_button.disabled = !has_next_page
|
||||
|
||||
clear_menu()
|
||||
if selected_device == null:
|
||||
|
|
|
@ -1,13 +1,20 @@
|
|||
extends Node3D
|
||||
|
||||
@onready var nav_view = $Navigation/View
|
||||
@onready var nav_edit: Button3D = $Navigation/Edit
|
||||
@onready var menu_edit: Node3D = $Content/EditMenu
|
||||
@onready var nav_room = $Navigation/Room
|
||||
@onready var menu_room: Node3D = $Content/RoomMenu
|
||||
@onready var nav_automate = $Navigation/Automate
|
||||
@onready var nav_settings = $Navigation/Settings
|
||||
@onready var menu_settings: Node3D = $Content/SettingsMenu
|
||||
@onready var _controller := XRHelpers.get_xr_controller(self)
|
||||
|
||||
@onready var nav_view = $AnimationContainer/Navigation/View
|
||||
@onready var nav_edit: Button3D = $AnimationContainer/Navigation/Edit
|
||||
@onready var menu_edit: Node3D = $AnimationContainer/Content/EditMenu
|
||||
@onready var nav_room = $AnimationContainer/Navigation/Room
|
||||
@onready var menu_room: Node3D = $AnimationContainer/Content/RoomMenu
|
||||
@onready var nav_automate = $AnimationContainer/Navigation/Automate
|
||||
@onready var nav_settings = $AnimationContainer/Navigation/Settings
|
||||
@onready var menu_settings: Node3D = $AnimationContainer/Content/SettingsMenu
|
||||
|
||||
@onready var menu_root = $AnimationContainer
|
||||
@onready var content = $AnimationContainer/Content
|
||||
@onready var nav = $AnimationContainer/Navigation
|
||||
@onready var animation_player = $AnimationPlayer
|
||||
|
||||
enum Menu {
|
||||
VIEW,
|
||||
|
@ -18,8 +25,25 @@ enum Menu {
|
|||
}
|
||||
|
||||
var selected_menu := Menu.EDIT
|
||||
var show_menu := true:
|
||||
get:
|
||||
return show_menu
|
||||
set(value):
|
||||
show_menu = value
|
||||
if value:
|
||||
animation_player.play_backwards("hide_menu")
|
||||
AudioPlayer.play_effect("open_menu")
|
||||
else:
|
||||
animation_player.play("hide_menu")
|
||||
AudioPlayer.play_effect("close_menu")
|
||||
|
||||
func _ready():
|
||||
_controller.button_pressed.connect(func(button):
|
||||
print(button)
|
||||
if button == "by_button":
|
||||
show_menu = !show_menu
|
||||
)
|
||||
|
||||
select_menu(selected_menu)
|
||||
|
||||
func _on_click(event):
|
||||
|
@ -36,9 +60,8 @@ func _on_click(event):
|
|||
|
||||
func select_menu(menu: Menu):
|
||||
selected_menu = menu
|
||||
for child in $Content.get_children():
|
||||
if child.is_visible():
|
||||
$Content.remove_child(child)
|
||||
for child in content.get_children():
|
||||
content.remove_child(child)
|
||||
|
||||
var menu_node = enum_to_menu(menu)
|
||||
var nav_node = enum_to_nav(menu)
|
||||
|
@ -47,9 +70,10 @@ func select_menu(menu: Menu):
|
|||
nav_node.disabled = true
|
||||
|
||||
if menu_node != null:
|
||||
$Content.add_child(menu_node)
|
||||
menu_node.visible = true
|
||||
content.add_child(menu_node)
|
||||
|
||||
for child in $Navigation.get_children():
|
||||
for child in nav.get_children():
|
||||
if child.active && child != nav_node:
|
||||
child.active = false
|
||||
child.disabled = false
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=13 format=3 uid="uid://c3kdssrmv84kv"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://c3kdssrmv84kv"]
|
||||
|
||||
[ext_resource type="Script" path="res://content/ui/menu/menu.gd" id="1_ng4u3"]
|
||||
[ext_resource type="PackedScene" uid="uid://crrb0l3ekuotj" path="res://content/ui/menu/edit/edit_menu.tscn" id="4_r2raj"]
|
||||
|
@ -15,76 +15,224 @@
|
|||
[sub_resource type="BoxMesh" id="BoxMesh_08du6"]
|
||||
size = Vector3(0.3, 0.01, 0.3)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_lkh72"]
|
||||
resource_name = "hide_menu"
|
||||
length = 0.4
|
||||
step = 0.01
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("AnimationContainer:rotation:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.4)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("AnimationContainer:rotation:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.4)
|
||||
}
|
||||
tracks/2/type = "bezier"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("AnimationContainer:rotation:z")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.18, -0.0484788, -1.5708, -0.24, 0.0818026, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.4)
|
||||
}
|
||||
tracks/3/type = "bezier"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("AnimationContainer:scale:x")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 0.01, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.4)
|
||||
}
|
||||
tracks/4/type = "bezier"
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/path = NodePath("AnimationContainer:scale:y")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 0.01, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.4)
|
||||
}
|
||||
tracks/5/type = "bezier"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("AnimationContainer:scale:z")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 0.01, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.4)
|
||||
}
|
||||
tracks/6/type = "value"
|
||||
tracks/6/imported = false
|
||||
tracks/6/enabled = true
|
||||
tracks/6/path = NodePath("AnimationContainer:visible")
|
||||
tracks/6/interp = 1
|
||||
tracks/6/loop_wrap = true
|
||||
tracks/6/keys = {
|
||||
"times": PackedFloat32Array(0.39, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [true, false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_61md4"]
|
||||
length = 0.001
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("AnimationContainer:scale:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("AnimationContainer:scale:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/2/type = "bezier"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("AnimationContainer:scale:z")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/path = NodePath("AnimationContainer:visible")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_s30cd"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_61md4"),
|
||||
"hide_menu": SubResource("Animation_lkh72")
|
||||
}
|
||||
|
||||
[node name="Menu" type="Node3D"]
|
||||
script = ExtResource("1_ng4u3")
|
||||
|
||||
[node name="Background" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15, 0, 0.15)
|
||||
[node name="AnimationContainer" type="Node3D" parent="."]
|
||||
|
||||
[node name="Background" type="MeshInstance3D" parent="AnimationContainer"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.21, 0, 0.15)
|
||||
mesh = SubResource("BoxMesh_08du6")
|
||||
skeleton = NodePath("../..")
|
||||
|
||||
[node name="Navigation" type="Node3D" parent="AnimationContainer"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.06, 0, 0)
|
||||
|
||||
[node name="View" parent="AnimationContainer/Navigation" instance=ExtResource("5_w4i01")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.03)
|
||||
toggleable = true
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="AnimationContainer/Navigation/View"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012, 0)
|
||||
pixel_size = 0.0002
|
||||
axis = 1
|
||||
texture = ExtResource("5_8o1rb")
|
||||
|
||||
[node name="Edit" parent="AnimationContainer/Navigation" instance=ExtResource("5_w4i01")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.09)
|
||||
toggleable = true
|
||||
initial_active = true
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="AnimationContainer/Navigation/Edit"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012, 0)
|
||||
pixel_size = 0.0002
|
||||
axis = 1
|
||||
texture = ExtResource("6_344ot")
|
||||
|
||||
[node name="Room" parent="AnimationContainer/Navigation" instance=ExtResource("5_w4i01")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.15)
|
||||
toggleable = true
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="AnimationContainer/Navigation/Room"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012, 0)
|
||||
pixel_size = 0.0002
|
||||
axis = 1
|
||||
texture = ExtResource("7_wvovx")
|
||||
|
||||
[node name="Automate" parent="AnimationContainer/Navigation" instance=ExtResource("5_w4i01")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.21)
|
||||
toggleable = true
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="AnimationContainer/Navigation/Automate"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012, 0)
|
||||
pixel_size = 0.0002
|
||||
axis = 1
|
||||
texture = ExtResource("8_3d082")
|
||||
|
||||
[node name="Settings" parent="AnimationContainer/Navigation" instance=ExtResource("5_w4i01")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.27)
|
||||
toggleable = true
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="AnimationContainer/Navigation/Settings"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012, 0)
|
||||
pixel_size = 0.0002
|
||||
axis = 1
|
||||
texture = ExtResource("9_mel13")
|
||||
|
||||
[node name="Content" type="Node3D" parent="AnimationContainer"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.06, 0, 0)
|
||||
|
||||
[node name="EditMenu" parent="AnimationContainer/Content" instance=ExtResource("4_r2raj")]
|
||||
|
||||
[node name="RoomMenu" parent="AnimationContainer/Content" instance=ExtResource("10_u4i1x")]
|
||||
visible = false
|
||||
|
||||
[node name="SettingsMenu" parent="AnimationContainer/Content" instance=ExtResource("11_7wm6b")]
|
||||
visible = false
|
||||
|
||||
[node name="ImmersiveHomePanels" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(-4.37114e-10, 0, 0.01, 0, 0.01, 0, -0.01, 0, -4.37114e-10, 0.32, 0, -0.0500001)
|
||||
visible = false
|
||||
mesh = ExtResource("7_f4u4o")
|
||||
|
||||
[node name="Navigation" type="Node3D" parent="."]
|
||||
|
||||
[node name="View" parent="Navigation" instance=ExtResource("5_w4i01")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.03)
|
||||
toggleable = true
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="Navigation/View"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012, 0)
|
||||
pixel_size = 0.0002
|
||||
axis = 1
|
||||
texture = ExtResource("5_8o1rb")
|
||||
|
||||
[node name="Edit" parent="Navigation" instance=ExtResource("5_w4i01")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.09)
|
||||
toggleable = true
|
||||
initial_active = true
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="Navigation/Edit"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012, 0)
|
||||
pixel_size = 0.0002
|
||||
axis = 1
|
||||
texture = ExtResource("6_344ot")
|
||||
|
||||
[node name="Room" parent="Navigation" instance=ExtResource("5_w4i01")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.15)
|
||||
toggleable = true
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="Navigation/Room"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012, 0)
|
||||
pixel_size = 0.0002
|
||||
axis = 1
|
||||
texture = ExtResource("7_wvovx")
|
||||
|
||||
[node name="Automate" parent="Navigation" instance=ExtResource("5_w4i01")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.21)
|
||||
toggleable = true
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="Navigation/Automate"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012, 0)
|
||||
pixel_size = 0.0002
|
||||
axis = 1
|
||||
texture = ExtResource("8_3d082")
|
||||
|
||||
[node name="Settings" parent="Navigation" instance=ExtResource("5_w4i01")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, 0, 0.27)
|
||||
toggleable = true
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="Navigation/Settings"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.012, 0)
|
||||
pixel_size = 0.0002
|
||||
axis = 1
|
||||
texture = ExtResource("9_mel13")
|
||||
|
||||
[node name="Content" type="Node3D" parent="."]
|
||||
|
||||
[node name="EditMenu" parent="Content" instance=ExtResource("4_r2raj")]
|
||||
|
||||
[node name="RoomMenu" parent="Content" instance=ExtResource("10_u4i1x")]
|
||||
|
||||
[node name="SettingsMenu" parent="Content" instance=ExtResource("11_7wm6b")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.01, 0)
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_s30cd")
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ extends Node3D
|
|||
|
||||
const ball_scene = preload("res://content/ui/menu/settings/ball.tscn")
|
||||
|
||||
@onready var clickable = $Button/Clickable
|
||||
@onready var balls = $Balls
|
||||
@onready var clickable = $Content/Button/Clickable
|
||||
@onready var connection_status = $Content/ConnectionStatus
|
||||
|
||||
func _ready():
|
||||
clickable.on_click.connect(func(event):
|
||||
|
@ -13,3 +13,11 @@ func _ready():
|
|||
get_tree().root.add_child(ball)
|
||||
)
|
||||
|
||||
HomeAdapters.adapter.adapter.on_connect.connect(func():
|
||||
connection_status.text = "Connected"
|
||||
)
|
||||
|
||||
HomeAdapters.adapter.adapter.on_disconnect.connect(func():
|
||||
connection_status.text = "Disconnected"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,19 +1,34 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://c6r4higceibif"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://c6r4higceibif"]
|
||||
|
||||
[ext_resource type="Script" path="res://content/ui/menu/settings/settings_menu.gd" id="1_0lte6"]
|
||||
[ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_faxng"]
|
||||
[ext_resource type="Script" path="res://content/functions/clickable.gd" id="3_qmg6q"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_e51x8"]
|
||||
size = Vector3(0.3, 0.01, 0.3)
|
||||
|
||||
[node name="SettingsMenu" type="Node3D"]
|
||||
script = ExtResource("1_0lte6")
|
||||
|
||||
[node name="Button" parent="." instance=ExtResource("1_faxng")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0458097, 0, 0.0435752)
|
||||
[node name="Background" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.15, 0, 0.15)
|
||||
mesh = SubResource("BoxMesh_e51x8")
|
||||
|
||||
[node name="Label3D" type="Label3D" parent="Button"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.138567, 0, 0)
|
||||
[node name="Content" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0102286, 0)
|
||||
|
||||
[node name="Label3D" type="Label3D" parent="Content"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.184377, 0, 0.0435752)
|
||||
pixel_size = 0.001
|
||||
text = "Spawn Ball"
|
||||
|
||||
[node name="Clickable" type="Node" parent="Button"]
|
||||
[node name="Button" parent="Content" instance=ExtResource("1_faxng")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0458097, 0, 0.0435752)
|
||||
|
||||
[node name="Clickable" type="Node" parent="Content/Button"]
|
||||
script = ExtResource("3_qmg6q")
|
||||
|
||||
[node name="ConnectionStatus" type="Label3D" parent="Content"]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.26, 0, 0.29)
|
||||
pixel_size = 0.0003
|
||||
text = "Disconnected"
|
||||
|
|
|
@ -2,6 +2,8 @@ extends AudioStreamPlayer
|
|||
|
||||
var click_sound = preload("res://assets/sound/click.wav")
|
||||
var spawn_sound = preload("res://assets/sound/spawn.wav")
|
||||
var open_menu = preload("res://assets/sound/open_menu.wav")
|
||||
var close_menu = preload("res://assets/sound/close_menu.wav")
|
||||
|
||||
func _ready():
|
||||
volume_db = -18
|
||||
|
@ -9,7 +11,15 @@ func _ready():
|
|||
func play_effect(sound):
|
||||
if sound == "click":
|
||||
stream = click_sound
|
||||
volume_db = -18
|
||||
elif sound == "spawn":
|
||||
stream = spawn_sound
|
||||
volume_db = -10
|
||||
elif sound == "open_menu":
|
||||
stream = open_menu
|
||||
volume_db = -6
|
||||
elif sound == "close_menu":
|
||||
stream = close_menu
|
||||
volume_db = -6
|
||||
|
||||
play()
|
||||
|
|
13
lib/globals/events.gd
Normal file
13
lib/globals/events.gd
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Global event bus
|
||||
extends Node
|
||||
|
||||
# Interaction Events
|
||||
signal on_click(event: Dictionary)
|
||||
signal on_press_down(event: Dictionary)
|
||||
signal on_press_move(event: Dictionary)
|
||||
signal on_press_up(event: Dictionary)
|
||||
signal on_grab_down(event: Dictionary)
|
||||
signal on_grab_move(event: Dictionary)
|
||||
signal on_grab_up(event: Dictionary)
|
||||
signal on_ray_enter(event: Dictionary)
|
||||
signal on_ray_leave(event: Dictionary)
|
|
@ -21,6 +21,7 @@ XRToolsUserSettings="*res://addons/godot-xr-tools/user_settings/user_settings.gd
|
|||
Request="*res://lib/globals/request.gd"
|
||||
HomeAdapters="*res://lib/globals/home_adapters.gd"
|
||||
AudioPlayer="*res://lib/globals/audio_player.gd"
|
||||
Events="*res://lib/globals/events.gd"
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user