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.

26 lines
897 B

  1. // Amplify Shader Editor - Visual Shader Editing Tool
  2. // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
  3. namespace AmplifyShaderEditor
  4. {
  5. [System.Serializable]
  6. [NodeAttributes( "Length", "Vector Operators", "Scalar Euclidean length of a vector" )]
  7. public sealed class LengthOpNode : SingleInputOp
  8. {
  9. protected override void CommonInit( int uniqueId )
  10. {
  11. base.CommonInit( uniqueId );
  12. m_opName = "length";
  13. m_previewShaderGUID = "1c1f6d6512b758942a8b9dd1bea12f34";
  14. m_inputPorts[ 0 ].CreatePortRestrictions( WirePortDataType.OBJECT,
  15. WirePortDataType.FLOAT ,
  16. WirePortDataType.FLOAT2,
  17. WirePortDataType.FLOAT3,
  18. WirePortDataType.FLOAT4,
  19. WirePortDataType.COLOR ,
  20. WirePortDataType.INT);
  21. m_inputPorts[ 0 ].ChangeType( WirePortDataType.FLOAT4, false );
  22. m_autoUpdateOutputPort = false;
  23. }
  24. }
  25. }