INode.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEditor.ShaderGraph;
  4. namespace UnityEditor.Graphing
  5. {
  6. enum ModificationScope
  7. {
  8. Nothing = 0,
  9. Node = 1,
  10. Graph = 2,
  11. Topological = 3,
  12. Layout = 4
  13. }
  14. delegate void OnNodeModified(AbstractMaterialNode node, ModificationScope scope);
  15. static class NodeExtensions
  16. {
  17. public static IEnumerable<T> GetSlots<T>(this AbstractMaterialNode node) where T : ISlot
  18. {
  19. var slots = new List<T>();
  20. node.GetSlots(slots);
  21. return slots;
  22. }
  23. public static IEnumerable<T> GetInputSlots<T>(this AbstractMaterialNode node) where T : ISlot
  24. {
  25. var slots = new List<T>();
  26. node.GetInputSlots(slots);
  27. return slots;
  28. }
  29. public static IEnumerable<T> GetOutputSlots<T>(this AbstractMaterialNode node) where T : ISlot
  30. {
  31. var slots = new List<T>();
  32. node.GetOutputSlots(slots);
  33. return slots;
  34. }
  35. }
  36. }