mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
4e3425eda9
- 将attackstar.svg从UI目录移动到resources/common目录 - 将VerticalColorBar.tscn从UI/Variants目录移动到根components目录 - 将LaserSummoner.tscn从Bullets/Common目录移动到Bullets根目录 - 移除调试日志打印语句 - 优化ItemStore.gd的getTexture方法默认值处理 - 更新相关场景和脚本中的资源引用路径 - 添加FeedFilter调试工具组件 - 优化ComponentManager初始化逻辑
24 lines
690 B
GDScript
24 lines
690 B
GDScript
class_name DirTool
|
|
|
|
static func listdir(path: String) -> Array[String]:
|
|
var files: Array[String] = []
|
|
var dir = DirAccess.open(path)
|
|
if !path.ends_with("/"):
|
|
path += "/"
|
|
if dir:
|
|
dir.list_dir_begin()
|
|
var file_name = dir.get_next()
|
|
while file_name != "":
|
|
if file_name != "." and file_name != "..":
|
|
if not file_name.get_extension() == "import":
|
|
if file_name.get_extension() == "remap":
|
|
file_name = file_name.substr(0, len(file_name) - 6)
|
|
files.append(path + file_name)
|
|
file_name = dir.get_next()
|
|
dir.list_dir_end()
|
|
return files
|
|
else:
|
|
return []
|
|
static func getBasenameWithoutExtension(path: String) -> String:
|
|
return path.get_file().get_basename()
|