24 lines
580 B
C#
24 lines
580 B
C#
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
|
|
{
|
|
BIT4Log.Warnning<Exec>($"未加载:{path}");
|
|
}
|
|
}
|
|
}
|