mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-20 12:19:32 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
30 lines
618 B
C#
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;
|
|
};
|
|
}
|