summaryrefslogtreecommitdiff
path: root/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/TFHCCompareLower.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-10-22 23:30:02 +0800
committerchai <chaifix@163.com>2020-10-22 23:30:02 +0800
commit917e9e0b320775634dc2e710f7deac74fd0822f0 (patch)
tree637f3cccc80e7738c8a077fa3ff59218b8b18ee8 /Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/TFHCCompareLower.cs
parent8268e4e308bd110dfea4ad849a7ff74e66951349 (diff)
* amplify shader editor
Diffstat (limited to 'Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/TFHCCompareLower.cs')
-rw-r--r--Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/TFHCCompareLower.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/TFHCCompareLower.cs b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/TFHCCompareLower.cs
new file mode 100644
index 00000000..8f989472
--- /dev/null
+++ b/Assets/AmplifyShaderEditor/Plugins/Editor/Nodes/LogicalOperators/TFHCCompareLower.cs
@@ -0,0 +1,35 @@
+// Amplify Shader Editor - Visual Shader Editing Tool
+// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
+//
+// Custom Node Compare (A < B)
+// Donated by The Four Headed Cat - @fourheadedcat
+
+using UnityEngine;
+using System;
+
+namespace AmplifyShaderEditor
+{
+ [Serializable]
+ [NodeAttributes("Compare (A < B)", "Logical Operators", "Check if A is lower than B. If true return value of True else return value of False", null, KeyCode.None, true, true, "Compare", typeof( Compare ), "The Four Headed Cat - @fourheadedcat" )]
+ public sealed class TFHCCompareLower : TFHCStub
+ {
+ protected override void CommonInit( int uniqueId )
+ {
+ base.CommonInit( uniqueId );
+ m_inputPorts[ 0 ].Name = "A";
+ m_inputPorts[ 1 ].Name = "B";
+ AddInputPort( WirePortDataType.FLOAT, false, "True" );
+ AddInputPort( WirePortDataType.FLOAT, false, "False" );
+ m_textLabelWidth = 100;
+ m_useInternalPortData = true;
+ m_previewShaderGUID = "8024509244392ed44b37c28473e66a8a";
+ }
+
+ public override string GenerateShaderForOutput( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar )
+ {
+ GetInputData( ref dataCollector, ignoreLocalvar );
+ string strout = "(( " + m_inputDataPort0 + " < " + m_inputDataPort1 + " ) ? " + m_inputDataPort2 + " : " + m_inputDataPort3 + " )";
+ return CreateOutputLocalVariable( 0, strout, ref dataCollector );
+ }
+ }
+}