You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

  1. // Amplify Shader Editor - Visual Shader Editing Tool
  2. // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
  3. using UnityEngine;
  4. using System;
  5. namespace AmplifyShaderEditor
  6. {
  7. [Serializable]
  8. [NodeAttributes( "Divide", "Math Operators", "Division of two values ( A / B )", null, KeyCode.D )]
  9. public sealed class SimpleDivideOpNode : 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 = "409f06d00d1094849b0834c52791fa72";
  28. }
  29. public override string BuildResults( int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar )
  30. {
  31. SetExtensibleInputData( outputId, ref dataCollector, ignoreLocalvar );
  32. string result = "( " + m_extensibleInputResults[ 0 ];
  33. for ( int i = 1; i < m_extensibleInputResults.Count; i++ )
  34. {
  35. result += " / " + m_extensibleInputResults[ i ];
  36. }
  37. result += " )";
  38. return result;
  39. }
  40. }
  41. }