iFactory.Godot/BITKit/Scripts/Core/Exec.cs

24 lines
579 B
C#
Raw Normal View History

2023-06-15 21:52:13 +08:00
using Godot;
using System.IO;
using Environment = System.Environment;
namespace BITKit;
public partial class Exec : Node
{
[Export] private string path;
public override void _Ready()
{
var filePath = Path.Combine(Environment.CurrentDirectory, path);
if (PathHelper.TryGetText(filePath,out var json))
{
json = File.ReadAllText(filePath);
DataParser.Set(json);
BIT4Log.Log<Exec>($"已加载:{path}");
}
else
{
2023-08-18 11:03:06 +08:00
BIT4Log.Warning<Exec>($"未加载:{path}");
2023-06-15 21:52:13 +08:00
}
}
}