diff options
author | chai <chaifix@163.com> | 2020-10-22 23:30:02 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-10-22 23:30:02 +0800 |
commit | 917e9e0b320775634dc2e710f7deac74fd0822f0 (patch) | |
tree | 637f3cccc80e7738c8a077fa3ff59218b8b18ee8 /Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs | |
parent | 8268e4e308bd110dfea4ad849a7ff74e66951349 (diff) |
* amplify shader editor
Diffstat (limited to 'Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs')
-rw-r--r-- | Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs new file mode 100644 index 00000000..4901dbbf --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs @@ -0,0 +1,32 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda <info@amplify.pt> +// +// Custom Node TAU +// Donated by The Four Headed Cat - @fourheadedcat + +using UnityEngine; +using System; + +namespace AmplifyShaderEditor +{ + [Serializable] + [NodeAttributes( "Tau", "Constants And Properties", "Tau constant (2*PI): 6.28318530718", null, KeyCode.None, true, false, null,null, "The Four Headed Cat - @fourheadedcat" )] + public sealed class TauNode : ParentNode + { + private readonly string Tau = ( 2.0 * Mathf.PI ).ToString(); + public TauNode() : base() { } + public TauNode( int uniqueId, float x, float y, float width, float height ) : base( uniqueId, x, y, width, height ) { } + + protected override void CommonInit( int uniqueId ) + { + base.CommonInit( uniqueId ); + AddOutputPort( WirePortDataType.FLOAT, Constants.EmptyPortValue ); + m_previewShaderGUID = "701bc295c0d75d8429eabcf45e8e008d"; + } + + public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar ) + { + return dataCollector.IsSRP? "TWO_PI": Tau; + } + } +} |