- Edited
Is there a way to show the properties of a custom class in the Inspector using _GetPropertyList()?
The Dictionary _get_property_list ( ) virtual example works, but not with a custom class. What could be the problem?
`using Godot;
[Tool]
public partial class Test : Node
{
public CustomInspector EgyediInspector { get; set; } = new CustomInspector();
[Tool]
public partial class CustomInspector : Node
{
public int Egesz;
public float Lebegopontos;
#if TOOLS
public override Godot.Collections.Array<Godot.Collections.Dictionary> GetPropertyList()
{
GD.Print("Start - CustomInspector.GetPropertyList()");
var properties = new Godot.Collections.Array<Godot.Collections.Dictionary>();
properties.Add(new Godot.Collections.Dictionary()
{
{ "name", "Egesz" },
{ "type", (int)Variant.Type.Int },
{ "usage", (int)PropertyUsageFlags.Default }
});
properties.Append(new Godot.Collections.Dictionary()
{
{ "name", "Lebegopontos" },
{ "type", (int)Variant.Type.Float },
{ "usage", (int)PropertyUsageFlags.Default },
});
properties.Append(new Godot.Collections.Dictionary()
{
{ "name", "CustomInspector/Szoveg" },
{ "type", (int)Variant.Type.String },
{ "usage", (int)PropertyUsageFlags.Default }
});
GD.Print("End - CustomInspector._GetPropertyList()");
return properties;
}
#endif
}
}`