fix forge issue

This commit is contained in:
2026-02-13 11:11:03 +01:00
parent 032e059826
commit 22c4301244
2 changed files with 19 additions and 13 deletions

View File

@@ -13,22 +13,27 @@ public partial class CueHandlerInspectorPlugin : EditorInspectorPlugin
public override bool _CanHandle(GodotObject @object)
{
// 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();
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;
if (@object.GetScript().As<CSharpScript>() is not { }) return false;
}
catch (Exception e)
{
return false;
}
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(

View File

@@ -1,4 +1,5 @@
extends Area3D
class_name TutoTrigger
@onready var control: Control = $Control