fix forge issue
This commit is contained in:
@@ -13,22 +13,27 @@ public partial class CueHandlerInspectorPlugin : EditorInspectorPlugin
|
|||||||
public override bool _CanHandle(GodotObject @object)
|
public override bool _CanHandle(GodotObject @object)
|
||||||
{
|
{
|
||||||
// Find out if its an implementation of CueHandler without having to add [Tool] attribute to them.
|
// Find out if its an implementation of CueHandler without having to add [Tool] attribute to them.
|
||||||
if (@object?.GetScript().As<CSharpScript>() is CSharpScript script)
|
try
|
||||||
{
|
{
|
||||||
StringName className = script.GetGlobalName();
|
if (@object.GetScript().As<CSharpScript>() is not { }) return false;
|
||||||
|
}
|
||||||
Type baseType = typeof(ForgeCueHandler);
|
catch (Exception e)
|
||||||
System.Reflection.Assembly assembly = baseType.Assembly;
|
{
|
||||||
|
return false;
|
||||||
Type? implementationType =
|
|
||||||
Array.Find(assembly.GetTypes(), x =>
|
|
||||||
x.Name == className &&
|
|
||||||
baseType.IsAssignableFrom(x));
|
|
||||||
|
|
||||||
return implementationType is not null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
var script = @object.GetScript().As<CSharpScript>();
|
||||||
|
StringName className = script.GetGlobalName();
|
||||||
|
|
||||||
|
Type baseType = typeof(ForgeCueHandler);
|
||||||
|
System.Reflection.Assembly assembly = baseType.Assembly;
|
||||||
|
|
||||||
|
Type? implementationType =
|
||||||
|
Array.Find(assembly.GetTypes(), x =>
|
||||||
|
x.Name == className &&
|
||||||
|
baseType.IsAssignableFrom(x));
|
||||||
|
|
||||||
|
return implementationType is not null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool _ParseProperty(
|
public override bool _ParseProperty(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
extends Area3D
|
extends Area3D
|
||||||
|
class_name TutoTrigger
|
||||||
|
|
||||||
@onready var control: Control = $Control
|
@onready var control: Control = $Control
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user