mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-08 20:57:13 +08:00
feat(调试工具): 添加武器过滤器组件并重构Feed过滤器
重构FeedFilter.gd使用Watcher类来管理状态,并添加新的WeaponFilter组件用于武器过滤
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
@tool
|
||||
extends Control
|
||||
|
||||
@export var clickToRebuild: bool = false
|
||||
|
||||
var watcher = Watcher.new(false)
|
||||
|
||||
func _ready():
|
||||
watcher.changed.connect(rebuild)
|
||||
rebuild()
|
||||
func _process(_delta):
|
||||
watcher.setState(clickToRebuild)
|
||||
|
||||
func rebuild():
|
||||
for i in get_children():
|
||||
i.queue_free()
|
||||
var files = DirTool.listdir("res://components/Weapons/")
|
||||
for file in files:
|
||||
var weapon = load(file).instantiate() as Weapon
|
||||
add_child(weapon)
|
||||
Reference in New Issue
Block a user