feat: 更新 IntoHole 的球体、滑槽和环境资产
- 为铁球、陶瓷球和木球制作风格化材质,归档 CC0 原始参考 - 更新方形球洞和实心滑槽,统一 90° 弯槽并兼容旧存档 - 用顺流泡沫表示水流方向,为冰块制作三种交错的裂纹 - 同步 Blender 源资产、Godot 加载、工坊和试玩预览
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
extends RefCounted
|
||||
|
||||
const SHADER := preload("res://assets/blocks/water/surface.gdshader")
|
||||
|
||||
static var materials_by_direction: Dictionary[Vector3, ShaderMaterial] = {}
|
||||
|
||||
static func apply(visual: Node3D, local_direction: Vector3) -> void:
|
||||
if not materials_by_direction.has(local_direction):
|
||||
var material := ShaderMaterial.new()
|
||||
material.shader = SHADER
|
||||
material.set_shader_parameter("local_flow_direction", local_direction)
|
||||
materials_by_direction[local_direction] = material
|
||||
var surface := materials_by_direction[local_direction]
|
||||
for node in visual.find_children("*", "MeshInstance3D", true, false):
|
||||
var mesh_view := node as MeshInstance3D
|
||||
for index in range(mesh_view.mesh.get_surface_count()):
|
||||
var source := mesh_view.mesh.surface_get_material(index)
|
||||
if source != null and source.resource_name.ends_with("water_surface"):
|
||||
mesh_view.set_surface_override_material(index, surface)
|
||||
Reference in New Issue
Block a user