SimpleSubtractOpNode.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Amplify Shader Editor - Visual Shader Editing Tool
  2. // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
  3. using System;
  4. using UnityEngine;
  5. namespace AmplifyShaderEditor
  6. {
  7. [Serializable]
  8. [NodeAttributes( "Subtract", "Math Operators", "Subtraction of two values ( A - B )", null, UnityEngine.KeyCode.S )]
  9. public sealed class SimpleSubtractOpNode : DynamicTypeNode
  10. {
  11. protected override void CommonInit( int uniqueId )
  12. {
  13. m_dynamicRestrictions = new WirePortDataType[]
  14. {
  15. WirePortDataType.OBJECT,
  16. WirePortDataType.FLOAT,
  17. WirePortDataType.FLOAT2,
  18. WirePortDataType.FLOAT3,
  19. WirePortDataType.FLOAT4,
  20. WirePortDataType.COLOR,
  21. WirePortDataType.FLOAT3x3,
  22. WirePortDataType.FLOAT4x4,
  23. WirePortDataType.INT
  24. };
  25. base.CommonInit( uniqueId );
  26. m_allowMatrixCheck = true;
  27. m_previewShaderGUID = "5725e8300be208449973f771ab6682f2";
  28. }
  29. public override string BuildResults( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar )
  30. {
  31. base.BuildResults( outputId, ref dataCollector, ignoreLocalvar );
  32. return "( " + m_inputA + " - " + m_inputB + " )";
  33. }
  34. }
  35. }