NotNode.cs 734 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Reflection;
  2. using UnityEngine;
  3. namespace UnityEditor.ShaderGraph
  4. {
  5. [Title("Utility", "Logic", "Not")]
  6. class NotNode : CodeFunctionNode
  7. {
  8. public NotNode()
  9. {
  10. name = "Not";
  11. }
  12. public override bool hasPreview
  13. {
  14. get { return false; }
  15. }
  16. protected override MethodInfo GetFunctionToConvert()
  17. {
  18. return GetType().GetMethod("Unity_Not", BindingFlags.Static | BindingFlags.NonPublic);
  19. }
  20. static string Unity_Not(
  21. [Slot(0, Binding.None)] Boolean In,
  22. [Slot(1, Binding.None)] out Boolean Out)
  23. {
  24. return
  25. @"
  26. {
  27. Out = !In;
  28. }
  29. ";
  30. }
  31. }
  32. }