
using Godot;
using Rokojori;
using System.Collections.Generic;

namespace Rokojori
{  
  [Tool]
  public partial class RokojoriPlugin:EditorPlugin
  {
    GizmoDrawerPlugin gizmoDrawerPlugin = new GizmoDrawerPlugin();

    public static readonly string path = "res://addons/rokojori_action_library";
    public static string Path( string path )
    {
      return RokojoriPlugin.path + "/" + path;
    }

    static readonly string RokojoriRootAutoLoad = "RokojoriRootAutoLoad";
    static readonly string RokojoriRootAutoLoadPath = Path( "Runtime/Godot/Root.cs" );

    public override void _EnablePlugin()
    {
      AddAutoloadSingleton( RokojoriRootAutoLoad, RokojoriRootAutoLoadPath );
    }

    public override void _DisablePlugin()
    {
      RemoveAutoloadSingleton( RokojoriRootAutoLoad );
    }

    public override void _EnterTree()
    {
      AddNode3DGizmoPlugin( gizmoDrawerPlugin );
    }

    public override void _ExitTree()
    {
      RemoveNode3DGizmoPlugin( gizmoDrawerPlugin );
    }
  }
}