apply boot material
This commit is contained in:
@@ -43,8 +43,23 @@ func _ready() -> void:
|
||||
add_to_group("player")
|
||||
player_mat = mesh_node.get_surface_override_material(0).duplicate() as StandardMaterial3D
|
||||
mesh_node.set_surface_override_material(0, player_mat)
|
||||
mesh_node_boot.visible = false
|
||||
_setup_indicator()
|
||||
|
||||
func _apply_boot_mesh(tier: int) -> void:
|
||||
if tier <= 0:
|
||||
mesh_node_boot.visible = false
|
||||
return
|
||||
mesh_node_boot.visible = true
|
||||
var tex := load("res://assets/boot%d.png" % tier) as Texture2D
|
||||
if tex == null:
|
||||
return
|
||||
var mat := mesh_node_boot.get_surface_override_material(0)
|
||||
if mat == null:
|
||||
mat = StandardMaterial3D.new()
|
||||
mesh_node_boot.set_surface_override_material(0, mat)
|
||||
(mat as StandardMaterial3D).albedo_texture = tex
|
||||
|
||||
func _setup_indicator() -> void:
|
||||
indicator_node.position.y = 0.02
|
||||
indicator_node.mesh = _make_kick_arc_mesh()
|
||||
@@ -280,6 +295,7 @@ func apply_upgrade(id: String) -> void:
|
||||
func apply_upgrade_boots(speed_bonus: float, _tier: int) -> void:
|
||||
kick_tier += 1
|
||||
move_speed += speed_bonus
|
||||
_apply_boot_mesh(kick_tier)
|
||||
var tw := create_tween()
|
||||
tw.tween_property(player_mat, "albedo_color", Color(1.0, 0.85, 0.2), 0.1)
|
||||
tw.tween_property(player_mat, "albedo_color", BASE_COLOR, 0.4)
|
||||
|
||||
Reference in New Issue
Block a user