- Implemented very basic support for method override nodes

- Cleanup
This commit is contained in:
Nils Hausfeld
2023-09-30 23:06:26 +02:00
parent aca6d7110d
commit 07d13f0144
2 changed files with 12 additions and 1 deletions

View File

@@ -744,6 +744,16 @@ namespace FlaxEditor.Surface.Archetypes
base.OnDestroy();
}
internal static bool IsInputCompatible(NodeArchetype nodeArch, ScriptType outputType, ConnectionsHint hint)
{
return false;
}
internal static bool IsOutputCompatible(NodeArchetype nodeArch, ScriptType inputType, ConnectionsHint hint)
{
return inputType.IsVoid;
}
}
private sealed class InvokeMethodNode : SurfaceNode
@@ -2460,6 +2470,8 @@ namespace FlaxEditor.Surface.Archetypes
Title = string.Empty,
Description = "Overrides the base class method with custom implementation",
Flags = NodeFlags.VisualScriptGraph | NodeFlags.NoSpawnViaGUI | NodeFlags.NoSpawnViaPaste,
IsInputCompatible = MethodOverrideNode.IsInputCompatible,
IsOutputCompatible = MethodOverrideNode.IsOutputCompatible,
Size = new Float2(240, 60),
DefaultValues = new object[]
{

View File

@@ -589,7 +589,6 @@ namespace FlaxEditor.Surface
node.DefaultValues[0] = name;
node.DefaultValues[1] = parameters.Length;
node.Title = "Override " + name;
node.Tag = member;
nodes.Add(node);
}
}