This commit is contained in:
2026-10-13 18:42:20 +08:00
parent f296b643d4
commit ed1a9949c8
10 changed files with 159 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
@tool
extends Node3D
const ToonApply = preload("res://shader/toon_apply.gd")
@export var cartoon_material: ShaderMaterial:
set(value):
cartoon_material = value
_apply_materials()
func _ready() -> void:
_apply_materials()
func _apply_materials():
if not is_inside_tree():
return
# 未指定时默认使用 ToonApply
var mat: Material = cartoon_material if cartoon_material != null else ToonApply as Material
for node in find_children("*", "MeshInstance3D", true, false):
if node is MeshInstance3D:
node.material_override = mat