StepNode.cs 753 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Reflection;
  2. namespace UnityEditor.ShaderGraph
  3. {
  4. [Title("Math", "Round", "Step")]
  5. class StepNode : CodeFunctionNode
  6. {
  7. public StepNode()
  8. {
  9. name = "Step";
  10. }
  11. protected override MethodInfo GetFunctionToConvert()
  12. {
  13. return GetType().GetMethod("Unity_Step", BindingFlags.Static | BindingFlags.NonPublic);
  14. }
  15. static string Unity_Step(
  16. [Slot(0, Binding.None, 1, 1, 1, 1)] DynamicDimensionVector Edge,
  17. [Slot(1, Binding.None, 0, 0, 0, 0)] DynamicDimensionVector In,
  18. [Slot(2, Binding.None)] out DynamicDimensionVector Out)
  19. {
  20. return
  21. @"
  22. {
  23. Out = step(Edge, In);
  24. }
  25. ";
  26. }
  27. }
  28. }