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]
20 lines
472 B
C#
20 lines
472 B
C#
|
|
namespace Editor.ShaderGraph.Nodes;
|
|
|
|
/// <summary>
|
|
/// Current time
|
|
/// </summary>
|
|
[Title( "Time" ), Category( "Variables" ), Icon( "timer" )]
|
|
public sealed class Time : ShaderNode
|
|
{
|
|
[JsonIgnore]
|
|
public float Value => RealTime.Now;
|
|
|
|
[Output( typeof( float ) ), Title( "Time" )]
|
|
[Hide]
|
|
public NodeResult.Func Result => ( GraphCompiler compiler ) =>
|
|
{
|
|
return new NodeResult( 1, compiler.IsPreview ? "g_flPreviewTime" : "g_flTime", compiler.IsNotPreview );
|
|
};
|
|
}
|