using System;
using System.Collections.Generic;
using System.Reflection;
using Godot;

namespace Rokojori
{
  [Tool]
  [GlobalClass]
  public partial class SerializeScene:Action
  {
    [Export]
    public Node root;

    [Export]
    public string outputPath;

    protected override void _OnTrigger( )
    {
      var serializedScene = new SerializedScene();

      serializedScene.Serialize( root, [ this ] );

      FilesSync.SaveJSON( outputPath, serializedScene );

    }

  }
}
