Browse Source

Moving from mesh per face to a single MeshInstance3D

pull/6/head
Ryan Reed 1 month ago
parent
commit
b504d1e914
31 changed files with 207 additions and 138 deletions
  1. +1
    -1
      assets/materials/dirt.tres
  2. +1
    -1
      assets/materials/leaves.tres
  3. +1
    -1
      assets/materials/stone.tres
  4. +9
    -0
      assets/materials/wood.tres
  5. +0
    -9
      assets/materials/wood_ends.tres
  6. +0
    -9
      assets/materials/wood_side.tres
  7. BIN
      assets/textures/dirt-block.png
  8. +4
    -4
      assets/textures/dirt-block.png.import
  9. BIN
      assets/textures/grass-block.png
  10. +35
    -0
      assets/textures/grass-block.png.import
  11. +0
    -0
      assets/textures/grass.png
  12. +3
    -3
      assets/textures/grass.png.import
  13. BIN
      assets/textures/leaves-block.png
  14. +35
    -0
      assets/textures/leaves-block.png.import
  15. BIN
      assets/textures/stone-block.png
  16. +35
    -0
      assets/textures/stone-block.png.import
  17. BIN
      assets/textures/wood-block.png
  18. +35
    -0
      assets/textures/wood-block.png.import
  19. BIN
      assets/textures/wood-end.png
  20. +0
    -0
      assets/textures/wood.png
  21. +3
    -3
      assets/textures/wood.png.import
  22. +1
    -7
      resources/block_resource.gd
  23. +1
    -1
      resources/blocks/001_dirt.tres
  24. +1
    -1
      resources/blocks/002_stone.tres
  25. +3
    -9
      resources/blocks/003_wood.tres
  26. +1
    -1
      resources/blocks/004_leaves.tres
  27. +6
    -12
      resources/inventory/player_inventory_testing.tres
  28. +6
    -27
      scenes/blocks/block.gd
  29. +12
    -35
      scenes/blocks/block.tscn
  30. +13
    -13
      scenes/blocks/dropped_block.tscn
  31. +1
    -1
      scenes/ui/quick_slots.tscn

+ 1
- 1
assets/materials/dirt.tres View File

@ -1,6 +1,6 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://uex0dq00xomt"]
[ext_resource type="Texture2D" uid="uid://li36txj7oweq" path="res://assets/textures/dirt.png" id="1_jy2vk"]
[ext_resource type="Texture2D" uid="uid://cm4x631rtdmrq" path="res://assets/textures/dirt-block.png" id="1_jy2vk"]
[resource]
albedo_texture = ExtResource("1_jy2vk")


+ 1
- 1
assets/materials/leaves.tres View File

@ -1,6 +1,6 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://d15n1p3spu3jg"]
[ext_resource type="Texture2D" uid="uid://goygbpyqhych" path="res://assets/textures/leaves.png" id="1_sli0o"]
[ext_resource type="Texture2D" uid="uid://cmtiotn1g7wxv" path="res://assets/textures/leaves-block.png" id="1_sli0o"]
[resource]
transparency = 1


+ 1
- 1
assets/materials/stone.tres View File

@ -1,6 +1,6 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://cx7m27qa4ds4s"]
[ext_resource type="Texture2D" uid="uid://ct1iawpfkdf5l" path="res://assets/textures/stone.png" id="1_vwsbh"]
[ext_resource type="Texture2D" uid="uid://ohcuqkbit3mc" path="res://assets/textures/stone-block.png" id="1_vwsbh"]
[resource]
albedo_texture = ExtResource("1_vwsbh")


+ 9
- 0
assets/materials/wood.tres View File

@ -0,0 +1,9 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://jearv8lmwhec"]
[ext_resource type="Texture2D" uid="uid://de2ll7i47211v" path="res://assets/textures/wood-block.png" id="1_7x6pw"]
[resource]
albedo_texture = ExtResource("1_7x6pw")
metallic_specular = 0.0
roughness = 0.0
texture_filter = 0

+ 0
- 9
assets/materials/wood_ends.tres View File

@ -1,9 +0,0 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bnqiumcb3ixan"]
[ext_resource type="Texture2D" uid="uid://dxh0tr1jn2sym" path="res://assets/textures/wood-end.png" id="1_vqb8t"]
[resource]
albedo_texture = ExtResource("1_vqb8t")
metallic_specular = 0.0
roughness = 0.0
texture_filter = 0

+ 0
- 9
assets/materials/wood_side.tres View File

@ -1,9 +0,0 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://h0naiw6swfkl"]
[ext_resource type="Texture2D" uid="uid://0mw651622h01" path="res://assets/textures/wood-side.png" id="1_voafl"]
[resource]
albedo_texture = ExtResource("1_voafl")
metallic_specular = 0.0
roughness = 0.0
texture_filter = 0

BIN
assets/textures/dirt-block.png View File

Before After
Width: 48  |  Height: 32  |  Size: 440 B

assets/textures/wood-end.png.import → assets/textures/dirt-block.png.import View File

@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dxh0tr1jn2sym"
path="res://.godot/imported/wood-end.png-880ae7062d85d2bd8bfc66b6bcdb95a8.ctex"
uid="uid://cm4x631rtdmrq"
path="res://.godot/imported/dirt-block.png-bfe7e3792ac49118c2f92d8dedccd3b1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/textures/wood-end.png"
dest_files=["res://.godot/imported/wood-end.png-880ae7062d85d2bd8bfc66b6bcdb95a8.ctex"]
source_file="res://assets/textures/dirt-block.png"
dest_files=["res://.godot/imported/dirt-block.png-bfe7e3792ac49118c2f92d8dedccd3b1.ctex"]
[params]

BIN
assets/textures/grass-block.png View File

Before After
Width: 48  |  Height: 32  |  Size: 933 B

+ 35
- 0
assets/textures/grass-block.png.import View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dsvk3faenewrl"
path.s3tc="res://.godot/imported/grass-block.png-a43533c53e78ccd42111c48d59e43ebf.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/textures/grass-block.png"
dest_files=["res://.godot/imported/grass-block.png-a43533c53e78ccd42111c48d59e43ebf.s3tc.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

assets/textures/dirt-grass.png → assets/textures/grass.png View File


assets/textures/dirt-grass.png.import → assets/textures/grass.png.import View File

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bgo4mb3atmbot"
path="res://.godot/imported/dirt-grass.png-12fb5ebf1f814e95cc24f2d6fd063398.ctex"
path="res://.godot/imported/grass.png-44de1b601ed5e0482c9aa195977ab90c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/textures/dirt-grass.png"
dest_files=["res://.godot/imported/dirt-grass.png-12fb5ebf1f814e95cc24f2d6fd063398.ctex"]
source_file="res://assets/textures/grass.png"
dest_files=["res://.godot/imported/grass.png-44de1b601ed5e0482c9aa195977ab90c.ctex"]
[params]

BIN
assets/textures/leaves-block.png View File

Before After
Width: 48  |  Height: 32  |  Size: 544 B

+ 35
- 0
assets/textures/leaves-block.png.import View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cmtiotn1g7wxv"
path.s3tc="res://.godot/imported/leaves-block.png-c01c16272b530ade3ca524610fc204a6.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/textures/leaves-block.png"
dest_files=["res://.godot/imported/leaves-block.png-c01c16272b530ade3ca524610fc204a6.s3tc.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

BIN
assets/textures/stone-block.png View File

Before After
Width: 48  |  Height: 32  |  Size: 272 B

+ 35
- 0
assets/textures/stone-block.png.import View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ohcuqkbit3mc"
path.s3tc="res://.godot/imported/stone-block.png-7d1af345ce6c8bdaa19899a5ad89c6da.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/textures/stone-block.png"
dest_files=["res://.godot/imported/stone-block.png-7d1af345ce6c8bdaa19899a5ad89c6da.s3tc.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

BIN
assets/textures/wood-block.png View File

Before After
Width: 48  |  Height: 32  |  Size: 685 B

+ 35
- 0
assets/textures/wood-block.png.import View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://de2ll7i47211v"
path.s3tc="res://.godot/imported/wood-block.png-443d7f141af0d10d126bdfee9ade4138.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://assets/textures/wood-block.png"
dest_files=["res://.godot/imported/wood-block.png-443d7f141af0d10d126bdfee9ade4138.s3tc.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

BIN
assets/textures/wood-end.png View File

Before After
Width: 16  |  Height: 16  |  Size: 805 B

assets/textures/wood-side.png → assets/textures/wood.png View File


assets/textures/wood-side.png.import → assets/textures/wood.png.import View File

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://0mw651622h01"
path="res://.godot/imported/wood-side.png-7d9834bbc960a2c99991aedb7dcfa31e.ctex"
path="res://.godot/imported/wood.png-eeb3ea6fc91501562e05b28492ed90b0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/textures/wood-side.png"
dest_files=["res://.godot/imported/wood-side.png-7d9834bbc960a2c99991aedb7dcfa31e.ctex"]
source_file="res://assets/textures/wood.png"
dest_files=["res://.godot/imported/wood.png-eeb3ea6fc91501562e05b28492ed90b0.ctex"]
[params]

+ 1
- 7
resources/block_resource.gd View File

@ -2,10 +2,4 @@ class_name BlockResource
extends ItemResource
## East material is also the default material if not provided
@export var material_east: StandardMaterial3D = null
@export var material_west: StandardMaterial3D = null
@export var material_north: StandardMaterial3D = null
@export var material_south: StandardMaterial3D = null
@export var material_top: StandardMaterial3D = null
@export var material_bottom: StandardMaterial3D = null
@export var material_texture: StandardMaterial3D = null

+ 1
- 1
resources/blocks/001_dirt.tres View File

@ -5,7 +5,7 @@
[resource]
script = ExtResource("1_ljghb")
material_east = ExtResource("1_n1cq6")
material_texture = ExtResource("1_n1cq6")
id = "001"
name = "Dirt"
amount = 0


+ 1
- 1
resources/blocks/002_stone.tres View File

@ -5,7 +5,7 @@
[resource]
script = ExtResource("1_63t5s")
material_east = ExtResource("1_6chm7")
material_texture = ExtResource("1_6chm7")
id = "002"
name = "Stone"
amount = 0


+ 3
- 9
resources/blocks/003_wood.tres View File

@ -1,17 +1,11 @@
[gd_resource type="Resource" script_class="BlockResource" load_steps=4 format=3 uid="uid://bvudydis6w27b"]
[gd_resource type="Resource" script_class="BlockResource" load_steps=3 format=3 uid="uid://bvudydis6w27b"]
[ext_resource type="Material" uid="uid://bnqiumcb3ixan" path="res://assets/materials/wood_ends.tres" id="1_1n8h6"]
[ext_resource type="Material" uid="uid://jearv8lmwhec" path="res://assets/materials/wood.tres" id="1_plhol"]
[ext_resource type="Script" uid="uid://dwrmy4mx0mw18" path="res://resources/block_resource.gd" id="2_1n8h6"]
[ext_resource type="Material" uid="uid://h0naiw6swfkl" path="res://assets/materials/wood_side.tres" id="2_o823h"]
[resource]
script = ExtResource("2_1n8h6")
material_east = ExtResource("2_o823h")
material_west = ExtResource("2_o823h")
material_north = ExtResource("2_o823h")
material_south = ExtResource("2_o823h")
material_top = ExtResource("1_1n8h6")
material_bottom = ExtResource("1_1n8h6")
material_texture = ExtResource("1_plhol")
id = "003"
name = "Wood"
amount = 0


+ 1
- 1
resources/blocks/004_leaves.tres View File

@ -5,7 +5,7 @@
[resource]
script = ExtResource("3_kuops")
material_east = ExtResource("1_dbmit")
material_texture = ExtResource("1_dbmit")
id = "004"
name = "Leaves"
amount = 0


+ 6
- 12
resources/inventory/player_inventory_testing.tres View File

@ -1,17 +1,16 @@
[gd_resource type="Resource" script_class="InventoryResource" load_steps=13 format=3 uid="uid://blfp6tiir282o"]
[gd_resource type="Resource" script_class="InventoryResource" load_steps=12 format=3 uid="uid://blfp6tiir282o"]
[ext_resource type="Script" uid="uid://becun6dj78v8d" path="res://resources/inventory_resource.gd" id="1_4v6mg"]
[ext_resource type="Script" uid="uid://bdx4q355l5ugl" path="res://resources/item_resource.gd" id="1_gg8jx"]
[ext_resource type="Material" uid="uid://uex0dq00xomt" path="res://assets/materials/dirt.tres" id="2_8w148"]
[ext_resource type="Script" uid="uid://dwrmy4mx0mw18" path="res://resources/block_resource.gd" id="3_vgvac"]
[ext_resource type="Material" uid="uid://cx7m27qa4ds4s" path="res://assets/materials/stone.tres" id="4_7yuhn"]
[ext_resource type="Material" uid="uid://bnqiumcb3ixan" path="res://assets/materials/wood_ends.tres" id="5_viap3"]
[ext_resource type="Material" uid="uid://h0naiw6swfkl" path="res://assets/materials/wood_side.tres" id="6_wqat2"]
[ext_resource type="Material" uid="uid://jearv8lmwhec" path="res://assets/materials/wood.tres" id="5_p27bu"]
[ext_resource type="Material" uid="uid://d15n1p3spu3jg" path="res://assets/materials/leaves.tres" id="7_xd1nd"]
[sub_resource type="Resource" id="Resource_jaam2"]
script = ExtResource("3_vgvac")
material_east = ExtResource("2_8w148")
material_texture = ExtResource("2_8w148")
id = "001"
name = "Dirt"
amount = 100
@ -21,7 +20,7 @@ metadata/_custom_type_script = "uid://dwrmy4mx0mw18"
[sub_resource type="Resource" id="Resource_4kby3"]
script = ExtResource("3_vgvac")
material_east = ExtResource("4_7yuhn")
material_texture = ExtResource("4_7yuhn")
id = "002"
name = "Stone"
amount = 100
@ -31,12 +30,7 @@ metadata/_custom_type_script = "uid://dwrmy4mx0mw18"
[sub_resource type="Resource" id="Resource_byct5"]
script = ExtResource("3_vgvac")
material_east = ExtResource("6_wqat2")
material_west = ExtResource("6_wqat2")
material_north = ExtResource("6_wqat2")
material_south = ExtResource("6_wqat2")
material_top = ExtResource("5_viap3")
material_bottom = ExtResource("5_viap3")
material_texture = ExtResource("5_p27bu")
id = "003"
name = "Wood"
amount = 100
@ -46,7 +40,7 @@ metadata/_custom_type_script = "uid://dwrmy4mx0mw18"
[sub_resource type="Resource" id="Resource_qycqj"]
script = ExtResource("3_vgvac")
material_east = ExtResource("7_xd1nd")
material_texture = ExtResource("7_xd1nd")
id = "004"
name = "Leaves"
amount = 100


+ 6
- 27
scenes/blocks/block.gd View File

@ -4,13 +4,7 @@ extends StaticBody3D
@onready var collision_shape: CollisionShape3D = $CollisionShape3D
@onready var highlight_mesh: MeshInstance3D = $HighlightMesh
@onready var east_face: MeshInstance3D = $BlockFaces/EastFace
@onready var west_face: MeshInstance3D = $BlockFaces/WestFace
@onready var north_face: MeshInstance3D = $BlockFaces/NorthFace
@onready var south_face: MeshInstance3D = $BlockFaces/SouthFace
@onready var top_face: MeshInstance3D = $BlockFaces/TopFace
@onready var bottom_face: MeshInstance3D = $BlockFaces/BottomFace
@onready var block_mesh: MeshInstance3D = $BlockMesh
var id: String
var resource: BlockResource
@ -21,7 +15,7 @@ func _exit_tree() -> void:
Waila.ref.release_target()
func _ready() -> void:
_apply_materials()
_apply_material()
func get_id() -> String:
@ -43,28 +37,13 @@ func release() -> void:
func set_id(block_id: String) -> void:
id = block_id
_load_resource_data()
_apply_materials()
_apply_material()
## Apply a specific material to a MeshInstance3D
## If material is null, the EastFace material from the BlockResource will be utilized
func _apply_material(face: MeshInstance3D, material: StandardMaterial3D) -> void:
if material == null:
material = resource.material_east # Default to East face (first)
face.set_surface_override_material(0, material)
func _apply_materials() -> void:
if east_face == null: return
func _apply_material() -> void:
if block_mesh == null: return
if resource == null: return
# This could probably be improved/simplified
_apply_material(east_face, resource.material_east)
_apply_material(west_face, resource.material_west)
_apply_material(north_face, resource.material_north)
_apply_material(south_face, resource.material_south)
_apply_material(top_face, resource.material_top)
_apply_material(bottom_face, resource.material_bottom)
block_mesh.set_surface_override_material(0, resource.material_texture)
func _load_resource_data() -> void:
if not id:


+ 12
- 35
scenes/blocks/block.tscn View File

@ -1,54 +1,31 @@
[gd_scene load_steps=6 format=3 uid="uid://col07xd76y60h"]
[gd_scene load_steps=8 format=3 uid="uid://b8evbp40gnomt"]
[ext_resource type="Script" uid="uid://buvqmrrtmxs2h" path="res://scenes/blocks/block.gd" id="1_7fut1"]
[ext_resource type="Material" uid="uid://bgc6efqf8aiqo" path="res://assets/materials/block_highlight.tres" id="2_524ei"]
[ext_resource type="Texture2D" uid="uid://dsvk3faenewrl" path="res://assets/textures/grass-block.png" id="3_qi7hx"]
[sub_resource type="BoxShape3D" id="BoxShape3D_n5naa"]
[sub_resource type="QuadMesh" id="QuadMesh_n5naa"]
[sub_resource type="BoxMesh" id="BoxMesh_7fut1"]
material = ExtResource("2_524ei")
size = Vector3(1.01, 1.01, 1.01)
[sub_resource type="BoxMesh" id="BoxMesh_e15ke"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4e127"]
albedo_texture = ExtResource("3_qi7hx")
texture_filter = 0
[node name="Block" type="StaticBody3D"]
script = ExtResource("1_7fut1")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("BoxShape3D_n5naa")
[node name="BlockFaces" type="Node3D" parent="."]
[node name="EastFace" type="MeshInstance3D" parent="BlockFaces"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5)
mesh = SubResource("QuadMesh_n5naa")
skeleton = NodePath("../..")
[node name="WestFace" type="MeshInstance3D" parent="BlockFaces"]
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0, -0.5)
mesh = SubResource("QuadMesh_n5naa")
skeleton = NodePath("../..")
[node name="NorthFace" type="MeshInstance3D" parent="BlockFaces"]
transform = Transform3D(-1.3411e-07, 0, -1, 0, 1, 0, 1, 0, -1.3411e-07, -0.5, 0, 7.45058e-09)
mesh = SubResource("QuadMesh_n5naa")
skeleton = NodePath("../..")
[node name="SouthFace" type="MeshInstance3D" parent="BlockFaces"]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.5, 0, 0)
mesh = SubResource("QuadMesh_n5naa")
skeleton = NodePath("../..")
[node name="TopFace" type="MeshInstance3D" parent="BlockFaces"]
transform = Transform3D(1.91069e-15, -1, -4.37114e-08, -4.37114e-08, -4.37114e-08, 1, -1, 0, -4.37114e-08, 0, 0.5, 0)
mesh = SubResource("QuadMesh_n5naa")
skeleton = NodePath("../..")
[node name="BottomFace" type="MeshInstance3D" parent="BlockFaces"]
transform = Transform3D(-4.37114e-08, 1, -4.37114e-08, 0, -4.37114e-08, -1, -1, -4.37114e-08, 1.91069e-15, 0, -0.5, 0)
mesh = SubResource("QuadMesh_n5naa")
skeleton = NodePath("../..")
[node name="HighlightMesh" type="MeshInstance3D" parent="."]
visible = false
mesh = SubResource("BoxMesh_7fut1")
[node name="BlockMesh" type="MeshInstance3D" parent="."]
mesh = SubResource("BoxMesh_e15ke")
surface_material_override/0 = SubResource("StandardMaterial3D_4e127")

+ 13
- 13
scenes/blocks/dropped_block.tscn View File

@ -1,10 +1,7 @@
[gd_scene load_steps=7 format=3 uid="uid://bn2olldntd7a6"]
[ext_resource type="Script" uid="uid://dkd2qbndc3q1o" path="res://scenes/blocks/dropped_block.gd" id="1_50ggx"]
[ext_resource type="PackedScene" uid="uid://col07xd76y60h" path="res://scenes/blocks/block.tscn" id="1_chlk1"]
[sub_resource type="SphereShape3D" id="SphereShape3D_5kft2"]
radius = 1.0
[ext_resource type="PackedScene" uid="uid://b8evbp40gnomt" path="res://scenes/blocks/block.tscn" id="3_qtifl"]
[sub_resource type="Animation" id="Animation_kym7p"]
length = 0.001
@ -30,7 +27,7 @@ tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0, 0.261799)]
"values": [Vector3(0, 0, 0)]
}
[sub_resource type="Animation" id="Animation_50ggx"]
@ -69,23 +66,26 @@ _data = {
&"start_animation": SubResource("Animation_50ggx")
}
[sub_resource type="SphereShape3D" id="SphereShape3D_5kft2"]
radius = 1.0
[node name="DroppedBlock" type="Node3D"]
script = ExtResource("1_50ggx")
[node name="Block" parent="." instance=ExtResource("1_chlk1")]
transform = Transform3D(0.965926, -0.258819, 0, 0.258819, 0.965926, 0, 0, 0, 1, 0, 0, 0)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_kym7p")
}
autoplay = "start_animation"
[node name="Block" parent="." instance=ExtResource("3_qtifl")]
[node name="PickupArea" type="Area3D" parent="Block"]
transform = Transform3D(0.965926, -0.258819, 0, 0.258819, 0.965926, 0, 0, 0, 1, 0, 0, 0)
collision_layer = 4
collision_mask = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="Block/PickupArea"]
shape = SubResource("SphereShape3D_5kft2")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_kym7p")
}
autoplay = "start_animation"
[connection signal="body_entered" from="Block/PickupArea" to="." method="_on_pickup_area_body_entered"]

+ 1
- 1
scenes/ui/quick_slots.tscn View File

@ -3,7 +3,7 @@
[ext_resource type="Script" uid="uid://bcq6vexsmyeol" path="res://scenes/ui/quick_slots.gd" id="1_cqw2g"]
[ext_resource type="Texture2D" uid="uid://li36txj7oweq" path="res://assets/textures/dirt.png" id="2_kotkb"]
[ext_resource type="Texture2D" uid="uid://ct1iawpfkdf5l" path="res://assets/textures/stone.png" id="3_cqw2g"]
[ext_resource type="Texture2D" uid="uid://0mw651622h01" path="res://assets/textures/wood-side.png" id="4_yyyxx"]
[ext_resource type="Texture2D" uid="uid://0mw651622h01" path="res://assets/textures/wood.png" id="4_yyyxx"]
[ext_resource type="Texture2D" uid="uid://goygbpyqhych" path="res://assets/textures/leaves.png" id="5_ps55n"]
[node name="QuickSlots" type="MarginContainer"]


Loading…
Cancel
Save