This repository was archived by the owner on Sep 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -9,29 +9,29 @@ public partial class Visualize : EditorPlugin
99 private const string PLUGIN = "Visualize" ;
1010 private const string AUTOLOAD = "VisualizeAutoload" ;
1111
12- public override void _EnterTree ( )
13- {
12+ public override void _EnablePlugin ( )
13+ {
1414 CSharpScript autoloadScript = GD . Load < CSharpScript > ( $ "res://addons/{ PLUGIN . ToLower ( ) } /Scripts/{ AUTOLOAD } .cs") ;
1515
1616 if ( ! ProjectSettings . HasSetting ( "autoload/" + AUTOLOAD ) )
1717 {
1818 ProjectSettings . SetSetting ( "autoload/" + AUTOLOAD , autoloadScript . ResourcePath ) ;
1919 Error error = ProjectSettings . Save ( ) ;
20-
20+ GD . Print ( "Enabled plugin" ) ;
2121 if ( error != Error . Ok )
2222 {
2323 GD . PushWarning ( $ "Failed to save project settings when entering { PLUGIN } plugin") ;
2424 }
2525 }
2626 }
2727
28- public override void _ExitTree ( )
29- {
28+ public override void _DisablePlugin ( )
29+ {
3030 if ( ProjectSettings . HasSetting ( "autoload/" + AUTOLOAD ) )
3131 {
3232 ProjectSettings . Clear ( "autoload/" + AUTOLOAD ) ;
3333 Error error = ProjectSettings . Save ( ) ;
34-
34+ GD . Print ( "Disabled plugin" ) ;
3535 if ( error != Error . Ok )
3636 {
3737 GD . PushWarning ( $ "Failed to save project settings when exiting { PLUGIN } plugin") ;
Original file line number Diff line number Diff line change @@ -26,3 +26,7 @@ project/assembly_name="Visualize"
2626[editor_plugins ]
2727
2828enabled =PackedStringArray ("res://addons/visualize/plugin.cfg" )
29+
30+ [plugin ]
31+
32+ visualize/enabled =true
You can’t perform that action at this time.
0 commit comments