Setup for dynamic elevator floor buttons
Add a button scene, as well as a button scene. Each button has an Area3D to detect collisons; a two-row sprite sheet contains all of the numbers and their on/off state.
This commit is contained in:
parent
acb10d18a4
commit
189823e8bf
9 changed files with 219 additions and 0 deletions
75
scenes/button_panel.tscn
Normal file
75
scenes/button_panel.tscn
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
[gd_scene format=3 uid="uid://cnjn0vhg1phav"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bw1kbbl3n83e8" path="res://scenes/floor_button.tscn" id="1_lff67"]
|
||||
|
||||
[node name="ButtonPanel" type="Node3D" unique_id=1270714626]
|
||||
|
||||
[node name="FloorButtons" type="Node3D" parent="." unique_id=1608506954]
|
||||
|
||||
[node name="00" parent="." unique_id=1628684586 instance=ExtResource("1_lff67")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -4.360477, 0)
|
||||
|
||||
[node name="01" parent="." unique_id=1324476691 instance=ExtResource("1_lff67")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.8598118, 0)
|
||||
|
||||
[node name="ButtonSprite" parent="01" index="0" unique_id=1628684586]
|
||||
frame = 1
|
||||
|
||||
[node name="02" parent="." unique_id=1143590285 instance=ExtResource("1_lff67")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.3875825, 0)
|
||||
|
||||
[node name="ButtonSprite" parent="02" index="0" unique_id=1628684586]
|
||||
frame = 2
|
||||
|
||||
[node name="03" parent="." unique_id=1467372561 instance=ExtResource("1_lff67")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.03961301, 0)
|
||||
|
||||
[node name="ButtonSprite" parent="03" index="0" unique_id=1628684586]
|
||||
frame = 3
|
||||
|
||||
[node name="04" parent="." unique_id=652433944 instance=ExtResource("1_lff67")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.3832786, 0)
|
||||
|
||||
[node name="ButtonSprite" parent="04" index="0" unique_id=1628684586]
|
||||
frame = 4
|
||||
|
||||
[node name="05" parent="." unique_id=470439905 instance=ExtResource("1_lff67")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.842876, 0)
|
||||
|
||||
[node name="ButtonSprite" parent="05" index="0" unique_id=1628684586]
|
||||
frame = 5
|
||||
|
||||
[node name="06" parent="." unique_id=1293107230 instance=ExtResource("1_lff67")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.1931896, 0)
|
||||
|
||||
[node name="ButtonSprite" parent="06" index="0" unique_id=1628684586]
|
||||
frame = 6
|
||||
|
||||
[node name="07" parent="." unique_id=1309697731 instance=ExtResource("1_lff67")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.632162, 0)
|
||||
|
||||
[node name="ButtonSprite" parent="07" index="0" unique_id=1628684586]
|
||||
frame = 7
|
||||
|
||||
[node name="08" parent="." unique_id=447931949 instance=ExtResource("1_lff67")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7.0681796, 0)
|
||||
|
||||
[node name="ButtonSprite" parent="08" index="0" unique_id=1628684586]
|
||||
frame = 8
|
||||
|
||||
[node name="09" parent="." unique_id=1200513083 instance=ExtResource("1_lff67")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8.490524, 0)
|
||||
|
||||
[node name="ButtonSprite" parent="09" index="0" unique_id=1628684586]
|
||||
frame = 9
|
||||
|
||||
[editable path="00"]
|
||||
[editable path="01"]
|
||||
[editable path="02"]
|
||||
[editable path="03"]
|
||||
[editable path="04"]
|
||||
[editable path="05"]
|
||||
[editable path="06"]
|
||||
[editable path="07"]
|
||||
[editable path="08"]
|
||||
[editable path="09"]
|
||||
19
scenes/floor_button.tscn
Normal file
19
scenes/floor_button.tscn
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[gd_scene format=3 uid="uid://bw1kbbl3n83e8"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://8bw5fmr1vkjn" path="res://images/elevator_numbers.png" id="1_4clxj"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_4clxj"]
|
||||
size = Vector3(1.1594238, 1, 0.055664063)
|
||||
|
||||
[node name="FloorButton" type="Area3D" unique_id=265465826]
|
||||
|
||||
[node name="ButtonSprite" type="Sprite3D" parent="." unique_id=1628684586]
|
||||
billboard = 1
|
||||
texture_filter = 0
|
||||
texture = ExtResource("1_4clxj")
|
||||
hframes = 10
|
||||
vframes = 2
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1160314093]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.361)
|
||||
shape = SubResource("BoxShape3D_4clxj")
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://bkqwi2yqa0nvg" path="res://scenes/virtua_hand.tscn" id="5_71j4m"]
|
||||
[ext_resource type="PackedScene" uid="uid://cwwexawpj46hk" path="res://scenes/elevator_button.tscn" id="5_qfnet"]
|
||||
[ext_resource type="Script" uid="uid://c6v2lhrkeup5i" path="res://scenes/world.gd" id="5_world"]
|
||||
[ext_resource type="PackedScene" uid="uid://cnjn0vhg1phav" path="res://scenes/button_panel.tscn" id="7_i7141"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_k0juu"]
|
||||
size = Vector3(3.8, 6.6328125, 0.8612671)
|
||||
|
|
@ -61,6 +62,9 @@ max_distance = 30.0
|
|||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.24584353, 2.8164063, -0.56969166)
|
||||
shape = SubResource("BoxShape3D_k0juu")
|
||||
|
||||
[node name="ButtonPanel" parent="ElevatorSafeZone" unique_id=1270714626 instance=ExtResource("7_i7141")]
|
||||
transform = Transform3D(0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 3.4193654, 2.2598982, -0.39259052)
|
||||
|
||||
[node name="SurvivorSpawn" type="Marker3D" parent="." unique_id=1095768768]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.9181392, 13.711893)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue