You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
c# plugin include assembly collection object throws error
`#if TOOLS
using Godot;
using System;
using System.Collections.Generic;
[Tool]
public partial class test_plugin : EditorPlugin
{
protected Control _control;
//this__object
protected Dictionary<int, object> _dic_object = new Dictionary<int, object>();
public test_plugin()
{
}
protected override void Dispose(bool disposing)
{
_control = null;
_dic_object.Clear();
_dic_object = null;
}
public override void _EnterTree()
{
// Initialization of the plugin goes here.
}
public override void _ExitTree()
{
}
public override void _EnablePlugin()
{
_control = new Control()
{
CustomMinimumSize = new Vector2(100, 100)
};
_control.AddChild(new Label()
{
Text = "hello",
CustomMinimumSize = new Vector2(100, 100)
});
GetEditorInterface().GetEditorMainScreen().AddChild(_control);
_MakeVisible(false);
object script = new Class1();
string json_data = Newtonsoft.Json.JsonConvert.SerializeObject(script);
_dic_object.Add(1, Newtonsoft.Json.JsonConvert.DeserializeObject(json_data, typeof(Class1))) ;
}
public override void _DisablePlugin()
{
base._DisablePlugin();
_dic_object.Clear();
GD.Print("_DisablePlugin");
}
public override void _MakeVisible(bool visible)
{
if (_control == null) return;
if (visible)
_control.Show();
else _control.Hide();
}
public override bool _HasMainScreen()
{
return true;
}
public override string _GetPluginName()
{
return "name";
}
Godot version
4.0 beta16
System information
windows11
Issue description
c# plugin include assembly collection object throws error
`#if TOOLS
using Godot;
using System;
using System.Collections.Generic;
[Tool]
public partial class test_plugin : EditorPlugin
{
protected Control _control;
//this__object
protected Dictionary<int, object> _dic_object = new Dictionary<int, object>();
}
#endif`
Steps to reproduce
1.enable [test_plugin] plugin
2.disable [test_plugin] plugin
3.changed [new_script.cs] code, rebuild project.
Minimal reproduction project
test_demo.zip
The text was updated successfully, but these errors were encountered: