Files
sbox-public/game/editor/ShaderGraph/Code/Nodes/Reroute.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

30 lines
618 B
C#

namespace Editor.ShaderGraph.Nodes;
public abstract class RerouteNode : BaseNode, IRerouteNode
{
/// <summary>
/// Comment to show above this node
/// </summary>
public string Comment { get; set; }
[Input, Hide, Title( "" )]
public NodeInput Input { get; set; }
public override NodeUI CreateUI( GraphView view )
{
return new RerouteUI( view, this );
}
}
public sealed class Reroute : RerouteNode
{
[Output, Hide, Title( "" )]
public NodeResult.Func Result => ( GraphCompiler compiler ) =>
{
var result = compiler.ResultOrDefault( Input, 0.0f );
result.Constant = true;
return result;
};
}