readme
This commit is contained in:
23
BITKit/Scripts/Core/Exec.cs
Normal file
23
BITKit/Scripts/Core/Exec.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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}");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user