From b82da95b5181ac8bbae38efb13e950d5e88a4caa Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 23 Oct 2020 13:08:43 +0800 Subject: =?UTF-8?q?*=E7=A7=BB=E5=8A=A8amplify=20shader=20editor=E5=88=B0th?= =?UTF-8?q?ird=20party=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Plugins/Editor/Nodes/Constants/TauNode.cs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs (limited to 'Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs') diff --git a/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs b/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs new file mode 100644 index 00000000..4901dbbf --- /dev/null +++ b/Assets/ThirdParty/AmplifyShaderEditor/Plugins/Editor/Nodes/Constants/TauNode.cs @@ -0,0 +1,32 @@ +// Amplify Shader Editor - Visual Shader Editing Tool +// Copyright (c) Amplify Creations, Lda +// +// 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; + } + } +} -- cgit v1.1-26-g67d0