调整了模板
This commit is contained in:
33
addons/BITPlugins/InspectorPlugins.cs
Normal file
33
addons/BITPlugins/InspectorPlugins.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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
|
Reference in New Issue
Block a user