iFactory.Godot/addons/BITPlugins/InspectorPlugins.cs

34 lines
778 B
C#
Raw Normal View History

2023-07-17 04:10:14 +08:00
using Godot;
using System;
namespace BITKit;
#if TOOLS
using Godot;
[Tool]
public partial class InspectorPlugins : EditorInspectorPlugin
{
public override bool _CanHandle(GodotObject @object)
{
return @object is Node;
}
public override bool _ParseProperty(
GodotObject @object,
Variant.Type type,
string name,
PropertyHint hintType,
string hintString,
PropertyUsageFlags usageFlags, bool wide)
{
// We handle properties of type integer.
if (type != Variant.Type.Int) return false;
// Create an instance of the custom property editor and register
// it to a specific property path.
AddPropertyEditor(name, new RandomIntEditor());
// Inform the editor to remove the default property editor for
// this property type.
return true;
}
}
#endif