Make comparisons automatically expand if needed so it contains the inputs
This commit is contained in:
@@ -20,6 +20,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
{
|
||||
TypeID = id,
|
||||
Title = title,
|
||||
Create = (id, context, arch, groupArch) => new ComparisonNode(id, context, arch, groupArch),
|
||||
Description = desc,
|
||||
Flags = NodeFlags.AllGraphs,
|
||||
AlternativeTitles = altTitles,
|
||||
@@ -44,6 +45,28 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
};
|
||||
}
|
||||
|
||||
private class ComparisonNode : SurfaceNode
|
||||
{
|
||||
public ComparisonNode(uint id, VisjectSurfaceContext context, NodeArchetype nodeArch, GroupArchetype groupArch)
|
||||
: base(id, context, nodeArch, groupArch)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnSurfaceLoaded(SurfaceNodeActions action)
|
||||
{
|
||||
base.OnSurfaceLoaded(action);
|
||||
|
||||
ResizeAuto();
|
||||
}
|
||||
|
||||
public override void ConnectionTick(Box box)
|
||||
{
|
||||
base.ConnectionTick(box);
|
||||
|
||||
ResizeAuto();
|
||||
}
|
||||
}
|
||||
|
||||
private class SwitchOnEnumNode : SurfaceNode
|
||||
{
|
||||
public SwitchOnEnumNode(uint id, VisjectSurfaceContext context, NodeArchetype nodeArch, GroupArchetype groupArch)
|
||||
@@ -181,6 +204,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
{
|
||||
TypeID = 7,
|
||||
Title = "Switch On Bool",
|
||||
Create = (id, context, arch, groupArch) => new ComparisonNode(id, context, arch, groupArch),
|
||||
AlternativeTitles = new[] { "if", "switch" },
|
||||
Description = "Returns one of the input values based on the condition value",
|
||||
Flags = NodeFlags.AllGraphs,
|
||||
|
||||
Reference in New Issue
Block a user